[PATCH for-next v3 10/10] RDMA/rxe: Minor cleanup in rxe_pool.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change pr_warn() to pr_debug()
Check if RXE_POOL_INDEX in rxe_pool_cleanup()

Signed-off-by: Bob Pearson <rpearsonhpe@xxxxxxxxx>
---
 drivers/infiniband/sw/rxe/rxe_pool.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_pool.c b/drivers/infiniband/sw/rxe/rxe_pool.c
index 2cd4d8803a0e..82efc4626bf6 100644
--- a/drivers/infiniband/sw/rxe/rxe_pool.c
+++ b/drivers/infiniband/sw/rxe/rxe_pool.c
@@ -88,7 +88,7 @@ static int rxe_pool_init_index(struct rxe_pool *pool, u32 max, u32 min)
 	size_t size;
 
 	if ((max - min + 1) < pool->max_elem) {
-		pr_warn("not enough indices for max_elem\n");
+		pr_debug("not enough indices for max_elem\n");
 		err = -EINVAL;
 		goto out;
 	}
@@ -155,10 +155,11 @@ int rxe_pool_init(
 void rxe_pool_cleanup(struct rxe_pool *pool)
 {
 	if (atomic_read(&pool->num_elem) > 0)
-		pr_warn("%s pool destroyed with unfree'd elem\n",
+		pr_debug("%s pool destroyed with unfree'd elem\n",
 			pool->name);
 
-	kfree(pool->index.table);
+	if (pool->flags & RXE_POOL_INDEX)
+		kfree(pool->index.table);
 }
 
 /* should never fail because there are at least as many indices as
@@ -194,7 +195,7 @@ static int rxe_insert_index(struct rxe_pool *pool, struct rxe_pool_entry *new)
 		 * old object was not deleted from the pool index
 		 */
 		if (unlikely(elem == new || elem->index == new->index)) {
-			pr_warn("%s#%d rf=%d: already in pool\n",
+			pr_debug("%s#%d(%d): already in pool\n",
 					pool->name, new->index,
 					refcount_read(&new->refcnt));
 			return -EINVAL;
@@ -228,7 +229,9 @@ static int rxe_insert_key(struct rxe_pool *pool, struct rxe_pool_entry *new)
 			     pool->key.key_size);
 
 		if (cmp == 0) {
-			pr_warn("key already exists!\n");
+			pr_debug("%s#%d(%d): key already in pool\n",
+					pool->name, new->index,
+					refcount_read(&new->refcnt));
 			return -EINVAL;
 		}
 
-- 
2.30.2




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux