From patchwork Sat Jul 28 01:25:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10547847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C2251822 for ; Sat, 28 Jul 2018 01:26:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58E862C52F for ; Sat, 28 Jul 2018 01:26:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B19F2C535; Sat, 28 Jul 2018 01:26:13 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 EB28D2C52F for ; Sat, 28 Jul 2018 01:26:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388998AbeG1Cuj (ORCPT ); Fri, 27 Jul 2018 22:50:39 -0400 Received: from mga06.intel.com ([134.134.136.31]:27983 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388893AbeG1Cuj (ORCPT ); Fri, 27 Jul 2018 22:50:39 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2018 18:26:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,412,1526367600"; d="scan'208";a="75217490" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga004.fm.intel.com with ESMTP; 27 Jul 2018 18:26:04 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1fjDzZ-000Row-PZ; Sat, 28 Jul 2018 09:25:57 +0800 Date: Sat, 28 Jul 2018 09:25:37 +0800 From: kbuild test robot To: Amit Kucheria Cc: kbuild-all@01.org, linux-pm@vger.kernel.org, Eduardo Valentin , Matthias Kaehlcke , Bjorn Andersson Subject: [PATCH] thermal: tsens: fix ptr_ret.cocci warnings Message-ID: <20180728012537.GA85570@roam> References: <201807280925.hVKZNIJe%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201807280925.hVKZNIJe%fengguang.wu@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: lkp@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot drivers/thermal/qcom/tsens-common.c:150: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: faa590baf8df ("thermal: tsens: switch from of_iomap() to devm_ioremap_resource()") CC: Amit Kucheria Signed-off-by: kbuild test robot Acked-by: Amit Kucheria --- tsens-common.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -147,8 +147,5 @@ int __init init_common(struct tsens_devi return PTR_ERR(base); tmdev->map = devm_regmap_init_mmio(tmdev->dev, base, &tsens_config); - if (IS_ERR(tmdev->map)) - return PTR_ERR(tmdev->map); - - return 0; + return PTR_ERR_OR_ZERO(tmdev->map); }