Skip to contentSkip to conversation

IB/mlx5: Remove dead code from alloc_cached_mr()

PATCH In review Roland Dreier 3 participants 3 messages Jul 27, 2015 – Jul 28, 2015 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/mlx5: Remove dead code from alloc_cached_mr()

From: Roland Dreier <[email protected]>

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.

---
 drivers/infiniband/hw/mlx5/mr.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/infiniband/hw/mlx5/mr.c +0 -3
index bc9a0de897cb..10d2b213a4d8 100644
@@ -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)
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): DB4PR05MB4488F2A60FCD345F59A9542C58E0@DB4PR05MB448.eurprd05.prod.outlook.com

A message that is not in the archive (sent off-list or not yet received): DB4PR05MB4488F2A60FCD345F59A9542C58E0-xsq7jzH2t6kaHWsdJSteB2u6+pknBqLbXA4E9RH9d+qIuWR1G4zioA@public.gmane.org

Acked-by
#3 lore raw
Quoted 6 lines

From: Roland Dreier <[email protected]>

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.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1438033403-13129-1-git-send-email-roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#5 lore raw
Quoted 17 lines · Roland Dreier

From: Roland Dreier <[email protected]>

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.

---
 drivers/infiniband/hw/mlx5/mr.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/infiniband/hw/mlx5/mr.c +0 -0
index bc9a0de897cb..10d2b213a4d8 100644

drivers/infiniband/hw/mlx5/mr.c static struct mlx5_ib_mr *alloc_cached_mr(struct mlx5_ib_dev *dev, int order) · line 446

Quoted 9 lines
drivers/infiniband/hw/mlx5/mr.c +0 -3
@@ -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)

Thanks Roland. Picking this up for 4.3 today.

Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD