From patchwork Mon Oct 8 18:18:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10631235 X-Patchwork-Delegate: bhelgaas@google.com 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 D7B3B174A for ; Mon, 8 Oct 2018 18:25:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9AB82994A for ; Mon, 8 Oct 2018 18:25:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB4F82995F; Mon, 8 Oct 2018 18:25:18 +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 5E3682994A for ; Mon, 8 Oct 2018 18:25:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726468AbeJIBiR (ORCPT ); Mon, 8 Oct 2018 21:38:17 -0400 Received: from mga11.intel.com ([192.55.52.93]:29254 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbeJIBiQ (ORCPT ); Mon, 8 Oct 2018 21:38:16 -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 fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2018 11:25:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,357,1534834800"; d="scan'208";a="77177794" Received: from lkp-server01.sh.intel.com (HELO lkp-server01) ([10.239.97.150]) by fmsmga008.fm.intel.com with ESMTP; 08 Oct 2018 11:18:25 -0700 Received: from kbuild by lkp-server01 with local (Exim 4.89) (envelope-from ) id 1g9a6q-000BN7-UM; Tue, 09 Oct 2018 02:18:24 +0800 Date: Tue, 9 Oct 2018 02:18:00 +0800 From: kbuild test robot To: Hanjie Lin Cc: kbuild-all@01.org, Lorenzo Pieralisi , Bjorn Helgaas , Yue Wang , Hanjie Lin , Kevin Hilman , Carlo Caione , Jerome Brunet , Rob Herring , Gustavo Pimentel , Shawn Lin , Philippe Ombredanne , Cyrille Pitchen , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Yixun Lan , Liang Yang , Jianxin Pan , Qiufang Dai , Jian Hu Subject: [PATCH] PCI: amlogic: fix ptr_ret.cocci warnings Message-ID: <20181008181800.GA119382@ivb43.lkp.intel.com> References: <1538999834-156423-3-git-send-email-hanjie.lin@amlogic.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1538999834-156423-3-git-send-email-hanjie.lin@amlogic.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot drivers/pci/controller/dwc/pci-meson.c:190:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/pci/controller/dwc/pci-meson.c:267: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: 32cd91ffa92f ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver") CC: Yue Wang Signed-off-by: kbuild test robot --- url: https://github.com/0day-ci/linux/commits/Hanjie-Lin/add-the-Amlogic-Meson-PCIe-controller-driver/20181009-001429 base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next pci-meson.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) --- a/drivers/pci/controller/dwc/pci-meson.c +++ b/drivers/pci/controller/dwc/pci-meson.c @@ -187,10 +187,7 @@ static int meson_pcie_get_mems(struct pl /* Meson SoC has two PCI controllers use same phy register*/ mp->mem_res.phy_base = meson_pcie_get_mem_shared(pdev, mp, "phy"); - if (IS_ERR(mp->mem_res.phy_base)) - return PTR_ERR(mp->mem_res.phy_base); - - return 0; + return PTR_ERR_OR_ZERO(mp->mem_res.phy_base); } static void meson_pcie_power_on(struct meson_pcie *mp) @@ -264,10 +261,7 @@ static int meson_pcie_probe_clocks(struc return PTR_ERR(res->general_clk); res->clk = meson_pcie_probe_clock(dev, "pcie", 0); - if (IS_ERR(res->clk)) - return PTR_ERR(res->clk); - - return 0; + return PTR_ERR_OR_ZERO(res->clk); } static inline void meson_elb_writel(struct meson_pcie *mp, u32 val, u32 reg)