ARM-S3C64xx: Adjustments for samsung_bl_set()
Subsystems (4)
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
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
@@ -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
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 +0200Omit extra messages for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- arch/arm/mach-s3c64xx/dev-backlight.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Thanks, applied.
Best regards,
Krzysztof
PATCH 2/2 ARM: s3c64xx: Delete an unnecessary return statement in samsung_bl_set()
In reply to SF Markus ElfringFrom: 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
@@ -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
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 +0200The 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.
Signed-off-by Markus Elfring <[email protected]>--- arch/arm/mach-s3c64xx/dev-backlight.c | 1 - 1 file changed, 1 deletion(-)
Thanks, applied.
Best regards,
Krzysztof