IB/mlx5: Remove dead code from alloc_cached_mr()
authorRoland Dreier <roland@purestorage.com>
Mon, 27 Jul 2015 21:43:23 +0000 (14:43 -0700)
committerDoug Ledford <dledford@redhat.com>
Sat, 29 Aug 2015 02:54:47 +0000 (22:54 -0400)
The only place that assigns mr inside the loop already does a break.
So "if (mr)" will never be true here since the function initializes mr
to NULL at the top.  We can just drop the extra if and break here.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Acked-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/mr.c

index bc9a0de..10d2b21 100644 (file)
@@ -441,9 +441,6 @@ static struct mlx5_ib_mr *alloc_cached_mr(struct mlx5_ib_dev *dev, int order)
                spin_unlock_irq(&ent->lock);
 
                queue_work(cache->wq, &ent->work);
-
-               if (mr)
-                       break;
        }
 
        if (!mr)