Skip to contentSkip to conversation

ARM-S3C64xx: Adjustments for samsung_bl_set()

PATCH Applied SF Markus Elfring 2 participants 5 messages Oct 2, 2017 – Oct 4, 2017

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

cover ARM-S3C64xx: Adjustments for samsung_bl_set()

From: Markus Elfring <[email protected]>
Date: Mon, 2 Oct 2017 22:34:56 +0200

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
Delete two error messages for a failed memory allocation Delete an unnecessary return statement

 arch/arm/mach-s3c64xx/dev-backlight.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
Signature · 1 line
2.14.2
#1 lore raw

PATCH 1/2 ARM: s3c64xx: Delete two error messages for a failed memory allocation in samsung_bl_set()

From: Markus Elfring <[email protected]>
Date: Mon, 2 Oct 2017 22:20:39 +0200

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 arch/arm/mach-s3c64xx/dev-backlight.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
arch/arm/mach-s3c64xx/dev-backlight.c +3 -6
index e62e789f9aee..7e2db762c442 100644
@@ -94,17 +94,14 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
 
 	samsung_bl_device = kmemdup(&samsung_dfl_bl_device,
 			sizeof(struct platform_device), GFP_KERNEL);
-	if (!samsung_bl_device) {
-		printk(KERN_ERR "%s: no memory for platform dev\n", __func__);
+	if (!samsung_bl_device)
 		return;
-	}
 
 	samsung_bl_drvdata = kmemdup(&samsung_dfl_bl_data,
 				sizeof(samsung_dfl_bl_data), GFP_KERNEL);
-	if (!samsung_bl_drvdata) {
-		printk(KERN_ERR "%s: no memory for platform dev\n", __func__);
+	if (!samsung_bl_drvdata)
 		goto err_data;
-	}
+
 	samsung_bl_device->dev.platform_data = &samsung_bl_drvdata->plat_data;
 	samsung_bl_drvdata->gpio_info = gpio_info;
 	samsung_bl_data = &samsung_bl_drvdata->plat_data;
Signature · 1 line
2.14.2
maintainer Applied
#2 lore raw

Re: [PATCH 1/2] ARM: s3c64xx: Delete two error messages for a failed memory allocation in samsung_bl_set()

Quoted 12 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 2 Oct 2017 22:20:39 +0200

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 arch/arm/mach-s3c64xx/dev-backlight.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Thanks, applied.

Best regards,
Krzysztof

#3 lore raw

PATCH 2/2 ARM: s3c64xx: Delete an unnecessary return statement in samsung_bl_set()

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 2 Oct 2017 22:30:55 +0200

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

WARNING: void function return statements are not generally useful

Thus remove such a statement in the affected function.

---
 arch/arm/mach-s3c64xx/dev-backlight.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-s3c64xx/dev-backlight.c +0 -1
index 7e2db762c442..7ef8b9019344 100644
@@ -141,5 +141,4 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
 	kfree(samsung_bl_data);
 err_data:
 	kfree(samsung_bl_device);
-	return;
 }
Signature · 1 line
2.14.2
maintainer Applied
#4 lore raw

Re: [PATCH 2/2] ARM: s3c64xx: Delete an unnecessary return statement in samsung_bl_set()

Quoted 5 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 2 Oct 2017 22:30:55 +0200

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

Quoted 9 lines

WARNING: void function return statements are not generally useful

Thus remove such a statement in the affected function.

---
 arch/arm/mach-s3c64xx/dev-backlight.c | 1 -
 1 file changed, 1 deletion(-)

Thanks, applied.

Best regards,
Krzysztof