From patchwork Thu Sep 7 10:02:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 9941955 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29CFD602CC for ; Thu, 7 Sep 2017 10:02:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39CF128600 for ; Thu, 7 Sep 2017 10:02:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E9CA28608; Thu, 7 Sep 2017 10:02:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A61A828600 for ; Thu, 7 Sep 2017 10:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753905AbdIGKCr (ORCPT ); Thu, 7 Sep 2017 06:02:47 -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 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2017 03:02:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,357,1500966000"; d="scan'208";a="308998690" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga004.fm.intel.com with ESMTP; 07 Sep 2017 03:02:44 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1dptir-000Phe-R9; Thu, 07 Sep 2017 18:07:45 +0800 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-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: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)