From mboxrd@z Thu Jan 1 00:00:00 1970 From: kbuild test robot Subject: [PATCH] Input: fix ptr_ret.cocci warnings Date: Fri, 17 Feb 2017 05:44:46 +0800 Message-ID: <20170216214443.GA93630@lkp-ib04.lkp.intel.com> References: <201702170545.UnYJQAQK%fengguang.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20170216175100.1668-3-benjamin.tissoires@redhat.com> Sender: linux-kernel-owner@vger.kernel.org To: Benjamin Tissoires Cc: kbuild-all@01.org, Dmitry Torokhov , Andrew Duggan , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org List-Id: linux-input@vger.kernel.org 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 Signed-off-by: Fengguang Wu --- 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)