public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tps65090-charger: Delete an error message for a failed memory allocation in two functions
@ 2017-12-16 18:43 SF Markus Elfring
  2017-12-16 18:53 ` [PATCH] tps65090-charger: Delete an error message for a failed memory allocation in two function Joe Perches
  0 siblings, 1 reply; 9+ messages in thread
From: SF Markus Elfring @ 2017-12-16 18:43 UTC (permalink / raw)
  To: linux-pm, Sebastian Reichel; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Dec 2017 19:32:02 +0100

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/power/supply/tps65090-charger.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/power/supply/tps65090-charger.c b/drivers/power/supply/tps65090-charger.c
index 1b4b5e09538e..43c44d2eaeca 100644
--- a/drivers/power/supply/tps65090-charger.c
+++ b/drivers/power/supply/tps65090-charger.c
@@ -202,10 +202,8 @@ static struct tps65090_platform_data *
 	unsigned int prop;
 
 	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
-	if (!pdata) {
-		dev_err(&pdev->dev, "Memory alloc for tps65090_pdata failed\n");
+	if (!pdata)
 		return NULL;
-	}
 
 	prop = of_property_read_bool(np, "ti,enable-low-current-chrg");
 	pdata->enable_low_current_chrg = prop;
@@ -257,10 +255,8 @@ static int tps65090_charger_probe(struct platform_device *pdev)
 	}
 
 	cdata = devm_kzalloc(&pdev->dev, sizeof(*cdata), GFP_KERNEL);
-	if (!cdata) {
-		dev_err(&pdev->dev, "failed to allocate memory status\n");
+	if (!cdata)
 		return -ENOMEM;
-	}
 
 	platform_set_drvdata(pdev, cdata);
 
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-12-18 17:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-16 18:43 [PATCH] tps65090-charger: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-12-16 18:53 ` [PATCH] tps65090-charger: Delete an error message for a failed memory allocation in two function Joe Perches
2017-12-16 20:30   ` tps65090-charger: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-12-16 20:36     ` Julia Lawall
2017-12-16 20:47       ` SF Markus Elfring
2017-12-18 17:24         ` Sebastian Reichel
2017-12-18 17:32           ` SF Markus Elfring
2017-12-16 20:40     ` Joe Perches
2017-12-16 20:52       ` SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox