[PATCH 2/6] ACPI-fan: Delete error messages for a failed memory allocation in two functions

From: SF Markus Elfring
Date: Tue Apr 18 2017 - 12:52:05 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
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