提交 7cea645a 编写于 作者: N Nathan Chancellor 提交者: Lee Jones

backlight: lm3639: Unconditionally call led_classdev_unregister

Clang warns that the address of a pointer will always evaluated as true
in a boolean context.

drivers/video/backlight/lm3639_bl.c:403:14: warning: address of
'pchip->cdev_torch' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        if (&pchip->cdev_torch)
        ~~   ~~~~~~~^~~~~~~~~~
drivers/video/backlight/lm3639_bl.c:405:14: warning: address of
'pchip->cdev_flash' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        if (&pchip->cdev_flash)
        ~~   ~~~~~~~^~~~~~~~~~
2 warnings generated.

These statements have been present since 2012, introduced by
commit 0f59858d ("backlight: add new lm3639 backlight
driver"). Given that they have been called unconditionally since
then presumably without any issues, removing the always true if
statements to fix the warnings without any real world changes.

Link: https://github.com/ClangBuiltLinux/linux/issues/119Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
Reviewed-by: NDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 e6bcca08
...@@ -400,10 +400,8 @@ static int lm3639_remove(struct i2c_client *client) ...@@ -400,10 +400,8 @@ static int lm3639_remove(struct i2c_client *client)
regmap_write(pchip->regmap, REG_ENABLE, 0x00); regmap_write(pchip->regmap, REG_ENABLE, 0x00);
if (&pchip->cdev_torch) led_classdev_unregister(&pchip->cdev_torch);
led_classdev_unregister(&pchip->cdev_torch); led_classdev_unregister(&pchip->cdev_flash);
if (&pchip->cdev_flash)
led_classdev_unregister(&pchip->cdev_flash);
if (pchip->bled) if (pchip->bled)
device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode); device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册