From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933643AbdBPVpX (ORCPT ); Thu, 16 Feb 2017 16:45:23 -0500 Received: from mga01.intel.com ([192.55.52.88]:21737 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933157AbdBPVpU (ORCPT ); Thu, 16 Feb 2017 16:45:20 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,169,1484035200"; d="scan'208";a="1109436697" Date: Fri, 17 Feb 2017 05:44:46 +0800 From: kbuild test robot To: Benjamin Tissoires Cc: kbuild-all@01.org, Dmitry Torokhov , Andrew Duggan , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH] Input: fix ptr_ret.cocci warnings 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 Content-Disposition: inline In-Reply-To: <20170216175100.1668-3-benjamin.tissoires@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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)