linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM-S3C64xx: Adjustments for samsung_bl_set()
@ 2017-10-02 20:39 SF Markus Elfring
  2017-10-02 20:39 ` [PATCH 1/2] ARM: s3c64xx: Delete two error messages for a failed memory allocation in samsung_bl_set() SF Markus Elfring
  2017-10-02 20:40 ` [PATCH 2/2] ARM: s3c64xx: Delete an unnecessary return statement " SF Markus Elfring
  0 siblings, 2 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-10-02 20:39 UTC (permalink / raw)
  To: linux-arm-kernel

From: Markus Elfring <elfring@users.sourceforge.net>
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(-)

-- 
2.14.2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] ARM: s3c64xx: Delete two error messages for a failed memory allocation in samsung_bl_set()
  2017-10-02 20:39 [PATCH 0/2] ARM-S3C64xx: Adjustments for samsung_bl_set() SF Markus Elfring
@ 2017-10-02 20:39 ` SF Markus Elfring
  2017-10-04 18:38   ` Krzysztof Kozlowski
  2017-10-02 20:40 ` [PATCH 2/2] ARM: s3c64xx: Delete an unnecessary return statement " SF Markus Elfring
  1 sibling, 1 reply; 5+ messages in thread
From: SF Markus Elfring @ 2017-10-02 20:39 UTC (permalink / raw)
  To: linux-arm-kernel

From: Markus Elfring <elfring@users.sourceforge.net>
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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/arm/mach-s3c64xx/dev-backlight.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/dev-backlight.c b/arch/arm/mach-s3c64xx/dev-backlight.c
index e62e789f9aee..7e2db762c442 100644
--- a/arch/arm/mach-s3c64xx/dev-backlight.c
+++ b/arch/arm/mach-s3c64xx/dev-backlight.c
@@ -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;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ARM: s3c64xx: Delete an unnecessary return statement in samsung_bl_set()
  2017-10-02 20:39 [PATCH 0/2] ARM-S3C64xx: Adjustments for samsung_bl_set() SF Markus Elfring
  2017-10-02 20:39 ` [PATCH 1/2] ARM: s3c64xx: Delete two error messages for a failed memory allocation in samsung_bl_set() SF Markus Elfring
@ 2017-10-02 20:40 ` SF Markus Elfring
  2017-10-04 18:40   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: SF Markus Elfring @ 2017-10-02 20:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Markus Elfring <elfring@users.sourceforge.net>
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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/arm/mach-s3c64xx/dev-backlight.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-s3c64xx/dev-backlight.c b/arch/arm/mach-s3c64xx/dev-backlight.c
index 7e2db762c442..7ef8b9019344 100644
--- a/arch/arm/mach-s3c64xx/dev-backlight.c
+++ b/arch/arm/mach-s3c64xx/dev-backlight.c
@@ -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;
 }
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/2] ARM: s3c64xx: Delete two error messages for a failed memory allocation in samsung_bl_set()
  2017-10-02 20:39 ` [PATCH 1/2] ARM: s3c64xx: Delete two error messages for a failed memory allocation in samsung_bl_set() SF Markus Elfring
@ 2017-10-04 18:38   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2017-10-04 18:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 02, 2017 at 10:39:56PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  arch/arm/mach-s3c64xx/dev-backlight.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 

Thanks, applied.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ARM: s3c64xx: Delete an unnecessary return statement in samsung_bl_set()
  2017-10-02 20:40 ` [PATCH 2/2] ARM: s3c64xx: Delete an unnecessary return statement " SF Markus Elfring
@ 2017-10-04 18:40   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2017-10-04 18:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 02, 2017 at 10:40:44PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  arch/arm/mach-s3c64xx/dev-backlight.c | 1 -
>  1 file changed, 1 deletion(-)
> 

Thanks, applied.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-04 18:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-02 20:39 [PATCH 0/2] ARM-S3C64xx: Adjustments for samsung_bl_set() SF Markus Elfring
2017-10-02 20:39 ` [PATCH 1/2] ARM: s3c64xx: Delete two error messages for a failed memory allocation in samsung_bl_set() SF Markus Elfring
2017-10-04 18:38   ` Krzysztof Kozlowski
2017-10-02 20:40 ` [PATCH 2/2] ARM: s3c64xx: Delete an unnecessary return statement " SF Markus Elfring
2017-10-04 18:40   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).