linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]backlight: lm3639: fix coccinelle warning.
@ 2012-11-08  6:44 G.Shark Jeong
  2012-11-08 20:27 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: G.Shark Jeong @ 2012-11-08  6:44 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Daniel Jeong, linux-kernel, Andrew Morton, G.Shark Jeong

From: "G.Shark Jeong" <gshark.jeong@gmail.com>

Fix coccinelle warning.

Signed-off-by: G.Shark Jeong <gshark.jeong@gmail.com>
---
 drivers/video/backlight/lm3639_bl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c
index 585949b..868a9da 100644
--- a/drivers/video/backlight/lm3639_bl.c
+++ b/drivers/video/backlight/lm3639_bl.c
@@ -403,9 +403,9 @@ static int __devexit lm3639_remove(struct i2c_client *client)
 
 	regmap_write(pchip->regmap, REG_ENABLE, 0x00);
 
-	if (&pchip->cdev_torch)
+	if ((&pchip->cdev_torch)!=NULL)
 		led_classdev_unregister(&pchip->cdev_torch);
-	if (&pchip->cdev_flash)
+	if ((&pchip->cdev_flash)!=NULL)
 		led_classdev_unregister(&pchip->cdev_flash);
 	if (pchip->bled) {
 		device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode);
-- 
1.7.5.4


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

* Re: [PATCH]backlight: lm3639: fix coccinelle warning.
  2012-11-08  6:44 [PATCH]backlight: lm3639: fix coccinelle warning G.Shark Jeong
@ 2012-11-08 20:27 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2012-11-08 20:27 UTC (permalink / raw)
  To: G.Shark Jeong; +Cc: Richard Purdie, Daniel Jeong, linux-kernel

On Thu,  8 Nov 2012 15:44:49 +0900
"G.Shark Jeong" <gshark.jeong@gmail.com> wrote:

> From: "G.Shark Jeong" <gshark.jeong@gmail.com>
> 
> Fix coccinelle warning.

Please always quote the warning or error message text in the changelog
when fixing an error or warning.

> diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c
> index 585949b..868a9da 100644
> --- a/drivers/video/backlight/lm3639_bl.c
> +++ b/drivers/video/backlight/lm3639_bl.c
> @@ -403,9 +403,9 @@ static int __devexit lm3639_remove(struct i2c_client *client)
>  
>  	regmap_write(pchip->regmap, REG_ENABLE, 0x00);
>  
> -	if (&pchip->cdev_torch)
> +	if ((&pchip->cdev_torch)!=NULL)
>  		led_classdev_unregister(&pchip->cdev_torch);
> -	if (&pchip->cdev_flash)
> +	if ((&pchip->cdev_flash)!=NULL)

Please use scripts/checkpatch.pl.



This code is just pointless.  The expression "&anything" will never
evaluate to NULL.


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

end of thread, other threads:[~2012-11-08 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08  6:44 [PATCH]backlight: lm3639: fix coccinelle warning G.Shark Jeong
2012-11-08 20:27 ` Andrew Morton

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).