Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754336AbdIGKCs (ORCPT ); Thu, 7 Sep 2017 06:02:48 -0400 Received: from mga02.intel.com ([134.134.136.20]:31557 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753393AbdIGKCq (ORCPT ); Thu, 7 Sep 2017 06:02:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,357,1500966000"; d="scan'208";a="308998690" Date: Thu, 7 Sep 2017 18:02:24 +0800 From: kbuild test robot To: Corentin Chary Cc: kbuild-all@01.org, Darren Hart , Andy Shevchenko , corentin.chary@gmail.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/x86: fix ptr_ret.cocci warnings Message-ID: <20170907100224.GA79024@lkp-wsx02> References: <201709071725.1hbpOsaR%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170904082110.30925-1-corentin.chary@gmail.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 Content-Length: 866 Lines: 28 drivers/platform/x86/thinkpad-wmi.c:1205: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 Fixes: 3af63e23450d ("drivers/x86: add thinkpad-wmi") CC: Corentin Chary Signed-off-by: Fengguang Wu --- thinkpad-wmi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/platform/x86/thinkpad-wmi.c +++ b/drivers/platform/x86/thinkpad-wmi.c @@ -1202,9 +1202,7 @@ static int __init thinkpad_wmi_init(void platform_device = platform_create_bundle(&platform_driver, thinkpad_wmi_probe, NULL, 0, NULL, 0); - if (IS_ERR(platform_device)) - return PTR_ERR(platform_device); - return 0; + return PTR_ERR_OR_ZERO(platform_device); } static void __exit thinkpad_wmi_exit(void)