Skip to contentSkip to conversation

RDMA/mlx5: Remove redundant allocation warning print

PATCH Applied Leon Romanovsky 3 participants 3 messages Jan 19, 2018 1 message not in the archive

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

PATCH 1/1 RDMA/mlx5: Remove redundant allocation warning print

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

The kmalloc() failure to allocate memory generates enough information and doesn't need to be accompanied by another driver print.

Fixes d69a24e03659 ("IB/mlx5: Move IB event processing onto a workqueue")

---
Changelog:
v0 -> v1:
* Fixed type in subject
* Removed "return" from end of void function

---
 drivers/infiniband/hw/mlx5/main.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
drivers/infiniband/hw/mlx5/main.c +8 -11
index f282e281eff2..5007280321b6 100644
@@ -3345,19 +3345,16 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,
 	struct mlx5_ib_event_work *work;
 
 	work = kmalloc(sizeof(*work), GFP_ATOMIC);
-	if (work) {
-		INIT_WORK(&work->work, mlx5_ib_handle_event);
-		work->dev = dev;
-		work->param = param;
-		work->context = context;
-		work->event = event;
-
-		queue_work(mlx5_ib_event_wq, &work->work);
+	if (!work)
 		return;
-	}
 
-	dev_warn(&dev->pdev->dev, "%s: mlx5_dev_event: %d, with param: %lu dropped, couldn't allocate memory.\n",
-		 __func__, event, param);
+	INIT_WORK(&work->work, mlx5_ib_handle_event);
+	work->dev = dev;
+	work->param = param;
+	work->context = context;
+	work->event = event;
+
+	queue_work(mlx5_ib_event_wq, &work->work);
 }
 
 static int set_has_smi_cap(struct mlx5_ib_dev *dev)

--
2.15.1

--
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): 20180119110711.8758-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 7 lines · Leon Romanovsky

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

The kmalloc() failure to allocate memory generates enough information and doesn't need to be accompanied by another driver print.

Fixes d69a24e03659 ("IB/mlx5: Move IB event processing onto a workqueue")
Quoted 42 lines

---
Changelog:
v0 -> v1:
* Fixed type in subject
* Removed "return" from end of void function

---
 drivers/infiniband/hw/mlx5/main.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
drivers/infiniband/hw/mlx5/main.c +8 -12
index f282e281eff2..5007280321b6 100644
@@ -3345,19 +3345,16 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,
 	struct mlx5_ib_event_work *work;
 
 	work = kmalloc(sizeof(*work), GFP_ATOMIC);
-	if (work) {
-		INIT_WORK(&work->work, mlx5_ib_handle_event);
-		work->dev = dev;
-		work->param = param;
-		work->context = context;
-		work->event = event;
-
-		queue_work(mlx5_ib_event_wq, &work->work);
+	if (!work)
 		return;
-	}
 
-	dev_warn(&dev->pdev->dev, "%s: mlx5_dev_event: %d, with param: %lu dropped, couldn't allocate memory.\n",
-		 __func__, event, param);
+	INIT_WORK(&work->work, mlx5_ib_handle_event);
+	work->dev = dev;
+	work->param = param;
+	work->context = context;
+	work->event = event;
+
+	queue_work(mlx5_ib_event_wq, &work->work);
 }
 
 static int set_has_smi_cap(struct mlx5_ib_dev *dev)
--
Quoted 2 lines

2.15.1

--
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

#3 lore raw
In reply to a message not in the archive
Quoted 8 lines · Leon Romanovsky

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

The kmalloc() failure to allocate memory generates enough information and doesn't need to be accompanied by another driver print.

Fixes d69a24e03659 ("IB/mlx5: Move IB event processing onto a workqueue")
Quoted 6 lines

Changelog:
v0 -> v1:
* Fixed type in subject
* Removed "return" from end of void function

 drivers/infiniband/hw/mlx5/main.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

Applied to for-next thanks

Jason
--
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