From patchwork Wed Jul 11 23:30:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kbuild test robot X-Patchwork-Id: 942731 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41QwLW58BNz9s2g for ; Thu, 12 Jul 2018 09:31:15 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390839AbeGKXhr (ORCPT ); Wed, 11 Jul 2018 19:37:47 -0400 Received: from mga12.intel.com ([192.55.52.136]:10319 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387997AbeGKXhr (ORCPT ); Wed, 11 Jul 2018 19:37:47 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jul 2018 16:31:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,339,1526367600"; d="scan'208";a="71604116" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga001.fm.intel.com with ESMTP; 11 Jul 2018 16:31:05 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1fdOZc-0003Zb-Q7; Thu, 12 Jul 2018 07:31:04 +0800 Date: Thu, 12 Jul 2018 07:30:41 +0800 From: kbuild test robot To: Shawn Lin Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Thierry Reding , Lorenzo Pieralisi , Jonathan Hunter , linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH] PCI: fix ptr_ret.cocci warnings Message-ID: <20180711233041.GA39597@lkp-sbx04> References: <201807120738.oIXXb65q%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201807120738.oIXXb65q%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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: kbuild test robot drivers/pci/controller/pci-tegra.c:1132: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: 6e0832fa432e ("PCI: Collect all native drivers under drivers/pci/controller/") CC: Shawn Lin Signed-off-by: kbuild test robot --- pci-tegra.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/pci/controller/pci-tegra.c +++ b/drivers/pci/controller/pci-tegra.c @@ -1129,10 +1129,7 @@ static int tegra_pcie_resets_get(struct return PTR_ERR(pcie->afi_rst); pcie->pcie_xrst = devm_reset_control_get_exclusive(dev, "pcie_x"); - if (IS_ERR(pcie->pcie_xrst)) - return PTR_ERR(pcie->pcie_xrst); - - return 0; + return PTR_ERR_OR_ZERO(pcie->pcie_xrst); } static int tegra_pcie_phys_get_legacy(struct tegra_pcie *pcie)