Skip to contentSkip to conversation

sata_dwc_460ex: Delete an error message for a failed memory allocation in sata_dwc_port_start()

PATCH In review SF Markus Elfring 4 participants 4 messages Feb 15, 2018 – Feb 18, 2018

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

PATCH 1/1 sata_dwc_460ex: Delete an error message for a failed memory allocation in sata_dwc_port_start()

From: Markus Elfring <[email protected]>
Date: Thu, 15 Feb 2018 22:15:25 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/ata/sata_dwc_460ex.c | 1 -
 1 file changed, 1 deletion(-)
drivers/ata/sata_dwc_460ex.c +0 -1
index 6af4ec3c88c3..ce3d6674ef80 100644
@@ -901,7 +901,6 @@ static int sata_dwc_port_start(struct ata_port *ap)
 	/* Allocate Port Struct */
 	hsdevp = kzalloc(sizeof(*hsdevp), GFP_KERNEL);
 	if (!hsdevp) {
-		dev_err(ap->dev, "%s: kmalloc failed for hsdevp\n", __func__);
 		err = -ENOMEM;
 		goto CLEANUP;
 	}
Signature · 1 line
2.16.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Thu, 15 Feb 2018 22:15:25 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Tejun, it's up to you. In case you are fine with the change,

Quoted 21 lines
---
 drivers/ata/sata_dwc_460ex.c | 1 -
 1 file changed, 1 deletion(-)
drivers/ata/sata_dwc_460ex.c +0 -1
index 6af4ec3c88c3..ce3d6674ef80 100644
@@ -901,7 +901,6 @@ static int sata_dwc_port_start(struct ata_port
 *ap)
 	/* Allocate Port Struct */
 	hsdevp = kzalloc(sizeof(*hsdevp), GFP_KERNEL);
 	if (!hsdevp) {
-		dev_err(ap->dev, "%s: kmalloc failed for hsdevp\n",
 __func__);
 		err = -ENOMEM;
drivers/ata/sata_dwc_460ex.c +0 -0
 		goto CLEANUP;
 	}
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#2 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 7 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Thu, 15 Feb 2018 22:15:25 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Tejun, it's up to you. In case you are fine with the change,

Yeah, these are marginal at best and one may be able to argue that emitting a message with device identifier is still useful but these allocations are order-zero and can't fail to begin with, so...

Thanks.

Signature · 1 line
tejun
#3 lore raw
Quoted 8 lines · Tejun Heo
Quoted 7 lines · Andy Shevchenko
Quoted 6 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Thu, 15 Feb 2018 22:15:25 +0100

Omit an extra message for a memory allocation failure in this function.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

This issue was detected by using the Coccinelle software.

Tejun, it's up to you. In case you are fine with the change,

Yeah, these are marginal at best and one may be able to argue that emitting a message with device identifier is still useful but these allocations are order-zero and can't fail to begin with, so...

IIRC device core prints a warn with error code and device name if ->probe() fails.

Signature · 2 lines
With Best Regards,
Andy Shevchenko