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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux