From patchwork Fri Jul 27 23:47:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10547841 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 4B87E139A for ; Fri, 27 Jul 2018 23:47:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14F7F2C071 for ; Fri, 27 Jul 2018 23:47:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0477F2C098; Fri, 27 Jul 2018 23:47:44 +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 9340D2BD28 for ; Fri, 27 Jul 2018 23:47:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389014AbeG1BLx (ORCPT ); Fri, 27 Jul 2018 21:11:53 -0400 Received: from mga05.intel.com ([192.55.52.43]:45148 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730850AbeG1BLx (ORCPT ); Fri, 27 Jul 2018 21:11:53 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2018 16:47:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,411,1526367600"; d="scan'208";a="58514766" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga008.fm.intel.com with ESMTP; 27 Jul 2018 16:47:40 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1fjCSS-000EPK-0V; Sat, 28 Jul 2018 07:47:40 +0800 Date: Sat, 28 Jul 2018 07:47:35 +0800 From: kbuild test robot To: Miquel Raynal Cc: kbuild-all@01.org, linux-pm@vger.kernel.org, Eduardo Valentin Subject: [PATCH] thermal: armada: fix ptr_ret.cocci warnings Message-ID: <20180727234735.GA136792@lkp-hsx02> References: <201807280728.Xpl17KLK%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201807280728.Xpl17KLK%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/armada_thermal.c:435:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/thermal/armada_thermal.c:445: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: 46d9e25062c2 ("thermal: armada: convert driver to syscon register accesses") CC: Miquel Raynal Signed-off-by: kbuild test robot --- armada_thermal.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -432,20 +432,14 @@ static int armada_thermal_probe_legacy(s priv->syscon = devm_regmap_init_mmio(&pdev->dev, base, &armada_thermal_regmap_config); - if (IS_ERR(priv->syscon)) - return PTR_ERR(priv->syscon); - - return 0; + return PTR_ERR_OR_ZERO(priv->syscon); } static int armada_thermal_probe_syscon(struct platform_device *pdev, struct armada_thermal_priv *priv) { priv->syscon = syscon_node_to_regmap(pdev->dev.parent->of_node); - if (IS_ERR(priv->syscon)) - return PTR_ERR(priv->syscon); - - return 0; + return PTR_ERR_OR_ZERO(priv->syscon); } static void armada_set_sane_name(struct platform_device *pdev,