Re: [PATCH]backlight: lm3639: fix coccinelle warning.

From: Andrew Morton
Date: Thu Nov 08 2012 - 15:27:14 EST


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

> From: "G.Shark Jeong" <gshark.jeong@xxxxxxxxx>
>
> 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.

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