Thread (14 messages) 14 messages, 7 authors, 2017-04-28

Re: [PATCH] fix ptr_ret.cocci warnings

From: Olimpiu Dejeu <hidden>
Date: 2017-03-21 14:59:33
Also in: linux-devicetree, lkml

On Fri, Mar 17, 2017 at 10:48 AM, kbuild test robot [off-list ref] wrote:
quoted hunk ↗ jump to hunk
drivers/video/backlight/arcxcnn_bl.c:183: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

CC: Olimpiu Dejeu <redacted>
Signed-off-by: Fengguang Wu <redacted>
---

 arcxcnn_bl.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/video/backlight/arcxcnn_bl.c
+++ b/drivers/video/backlight/arcxcnn_bl.c
@@ -180,10 +180,7 @@ static int arcxcnn_backlight_register(st

        lp->bl = devm_backlight_device_register(lp->dev, name, lp->dev, lp,
                                       &arcxcnn_bl_ops, props);
-       if (IS_ERR(lp->bl))
-               return PTR_ERR(lp->bl);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(lp->bl);
 }

 static void arcxcnn_parse_dt(struct arcxcnn *lp)
Acked-by: Olimpiu Dejeu <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help