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


Groups > linux.kernel > #1582961

[PATCH] Input: fix ptr_ret.cocci warnings

From kbuild test robot <lkp@intel.com>
Newsgroups linux.kernel
Subject [PATCH] Input: fix ptr_ret.cocci warnings
Date 2017-02-16 22:50 +0100
Message-ID <tbC65-3M4-7@gated-at.bofh.it> (permalink)
References <tbC65-3M4-5@gated-at.bofh.it> <tbyvy-1iO-69@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


drivers/input/mouse/synaptics.c:279: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: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 synaptics.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -276,10 +276,7 @@ static int synaptics_create_intertouch(s
 	pdevinfo.parent = &psmouse->ps2dev.serio->dev;
 
 	pdev = platform_device_register_full(&pdevinfo);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(pdev);
 }
 
 static int synaptics_remove_intertouch_device(struct device *dev, void *data)

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


Thread

[PATCH v2 0/3] Bind RMI4 over SMBus from PS/2 Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-02-16 19:00 +0100
  [PATCH v2 2/3] Input: synaptics - allocate a Synaptics Intertouch device Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-02-16 19:00 +0100
    Re: [PATCH v2 2/3] Input: synaptics - allocate a Synaptics  Intertouch device kbuild test robot <lkp@intel.com> - 2017-02-16 22:50 +0100
    [PATCH] Input: fix ptr_ret.cocci warnings kbuild test robot <lkp@intel.com> - 2017-02-16 22:50 +0100
  [PATCH v2 4/3] Input: ps2smbus - force PS/2 disable before SMBus gets resumed Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-02-17 12:50 +0100

csiph-web