Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1603383

[PATCH] fix ptr_ret.cocci warnings

From kbuild test robot <lkp@intel.com>
Newsgroups linux.kernel
Subject [PATCH] fix ptr_ret.cocci warnings
Date 2017-03-17 16:10 +0100
Message-ID <tm1FU-8kN-23@gated-at.bofh.it> (permalink)
References <tm1FU-8kN-17@gated-at.bofh.it> <tlnfs-3Ul-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <olimpiu@arcticsand.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 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)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v8 1/3] backlight arcxcnn add arc to vendor prefix Olimpiu Dejeu <olimpiu@arcticsand.com> - 2017-03-15 21:00 +0100
  [PATCH v8 2/3] backlight arcxcnn devicetree bindings for ArcticSand Olimpiu Dejeu <olimpiu@arcticsand.com> - 2017-03-15 21:00 +0100
  [PATCH v8 3/3] backlight arcxcnn add support for ArcticSand devices Olimpiu Dejeu <olimpiu@arcticsand.com> - 2017-03-15 21:00 +0100
    Re: [PATCH v8 3/3] backlight arcxcnn add support for ArcticSand  devices kbuild test robot <lkp@intel.com> - 2017-03-17 16:10 +0100
    [PATCH] fix ptr_ret.cocci warnings kbuild test robot <lkp@intel.com> - 2017-03-17 16:10 +0100
      Re: [PATCH] fix ptr_ret.cocci warnings Olimpiu Dejeu <olimpiu@arcticsand.com> - 2017-03-21 16:00 +0100
        Re: [PATCH] fix ptr_ret.cocci warnings Daniel Thompson <daniel.thompson@linaro.org> - 2017-03-21 16:10 +0100

csiph-web