lkml.org 
[lkml]   [2017]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/6] ACPI-fan: Delete error messages for a failed memory allocation in two functions
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 18 Apr 2017 17:10:40 +0200

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such statements here.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/fan.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 92878c7c523b..daa8f28a4b0e 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -301,7 +301,6 @@ static int acpi_fan_get_fps(struct acpi_device *device)
fan->fps = devm_kcalloc(&device->dev, fan->fps_count, sizeof(*fan->fps),
GFP_KERNEL);
if (!fan->fps) {
- dev_err(&device->dev, "Not enough memory\n");
status = -ENOMEM;
goto err;
}
@@ -334,10 +333,9 @@ static int acpi_fan_probe(struct platform_device *pdev)
char *name;

fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
- if (!fan) {
- dev_err(&device->dev, "No memory for fan\n");
+ if (!fan)
return -ENOMEM;
- }
+
device->driver_data = fan;
platform_set_drvdata(pdev, fan);

--
2.12.2
\
 
 \ /
  Last update: 2017-04-18 18:52    [W:0.093 / U:5.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site