drivers/video/backlight/pm8941-wled.c:404:1-3: WARNING: PTR_ERR_OR_ZERO can be used
kbuild test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 85051e295fb7487fd22546f86058e99d5266dd88 commit: 7ddbc2423c3301280b883bbb04b998203f30312c backlight: pm8941-wled: Move PM8941 WLED driver to backlight date: 9 weeks ago
coccinelle warnings: (new ones prefixed by >>)
>> drivers/video/backlight/pm8941-wled.c:404:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
kbuild test robot
build bot[PATCH] backlight: pm8941-wled: fix ptr_ret.cocci warnings
drivers/video/backlight/pm8941-wled.c:404:1-3: WARNING: PTR_ERR_OR_ZERO can be used
drivers/video/backlight/pm8941-wled.c:404:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
---
pm8941-wled.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/video/backlight/pm8941-wled.c +1 -4
@@ -401,10 +401,7 @@ static int pm8941_wled_probe(struct plat bl =devm_backlight_device_register (&pdev->dev, wled->name, &pdev->dev, wled, &pm8941_wled_ops, &props); -if (IS_ERR (bl)) -return PTR_ERR (bl); - -return 0 ; +return PTR_ERR_OR_ZERO (bl); };static const struct of_device_id pm8941_wled_match_table[] = {
Bjorn Andersson
Acked-byRe: [PATCH] backlight: pm8941-wled: fix ptr_ret.cocci warnings
Quoted 7 lines · kbuild test robot
drivers/video/backlight/pm8941-wled.c:404:1-3: WARNING:
PTR_ERR_OR_ZEROcan be usedUse
PTR_ERR_OR_ZEROrather than if(IS_ERR(...)) +PTR_ERRGenerated by:
scripts/coccinelle/api/ptr_ret.cocci
Cool, I didn't know that. Thanks
Quoted 1 line
Signed-off-by Fengguang Wu <[email protected]>
Regards,
Bjorn
Lee Jones
AppliedRe: [PATCH] backlight: pm8941-wled: fix ptr_ret.cocci warnings
In reply to kbuild test robotQuoted 5 lines · kbuild test robot
drivers/video/backlight/pm8941-wled.c:404:1-3: WARNING:
PTR_ERR_OR_ZEROcan be usedUse
PTR_ERR_OR_ZEROrather than if(IS_ERR(...)) +PTR_ERR
Quoted 8 lines
Generated by:
scripts/coccinelle/api/ptr_ret.cocciCC Bjorn Andersson <[email protected]>Signed-off-by Fengguang Wu <[email protected]>---
pm8941-wled.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Applied, thanks.
Quoted 14 lines
drivers/video/backlight/pm8941-wled.c +1
-4@@ -401,10 +401,7 @@ static int pm8941_wled_probe(struct plat bl =devm_backlight_device_register (&pdev->dev, wled->name, &pdev->dev, wled, &pm8941_wled_ops, &props); -if (IS_ERR (bl)) -return PTR_ERR (bl); - -return 0 ; +return PTR_ERR_OR_ZERO (bl); };static const struct of_device_id pm8941_wled_match_table[] = {
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog