Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp841629pxu; Thu, 15 Oct 2020 19:03:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsHMSKZjGk4puJlzwyNv8nfJsVzFSaP4TxMqSYDyJW9AxOCWOFqxGOHBT1xCZvv2vJZ/Uy X-Received: by 2002:a17:907:270f:: with SMTP id w15mr1258266ejk.505.1602813804423; Thu, 15 Oct 2020 19:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602813804; cv=none; d=google.com; s=arc-20160816; b=uez2f3rokrwZkLzbA5ZBnqCx2celRuaSEx6m6eSUVi8f0M+4tuYoNi4dU2+EqDr4F9 ps3+d7gr951/IxaNQwMvWxvqjp40CQZdD3Mp0HJc59b3FSljNXEQ+1rQ8y2KzrzBof9U grz2BJ+k4BaWyQotP34YuBXUwIPCHPqtmk4oSp5VBJUVMhFjk9IR9e1UQmyWFgnzZI6a CQDdGuybcxjqRM/5PfjiWtfUSvk9wL39bTfBA/2CkUwf45T3pyWj028FlilLvb58Tvj6 iH1X/E2U214DpDgp4GzA3C2Zn0E5e6OO7kn/87WPMRxSA1g986wK/Uh8j2UVvCeKQW4J e/2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=0c/JONLL/FRrSvwQ4PVvmvGdLpt/b1FZX+mwA7CeAjQ=; b=EULAlie7nA7Eyi6Dsk8/wO2SlAe6LJUDGXplSNifzqaDhVZqQmuII+/mb+lL+oqV4w NeaRPacdfkj9cyHKn8WDEV8/jIoLb5aHq9tAG9HkmRJ2UW6lpbhoWbPVIJWx98wKJFyo bcu+KBERzreTDpwgUdHN+et9L+uQU87JADWb5390NbVpUXo8IA/yx3MpPc1DU4fxUbnk Rp98KpmozsjCSs+C80D0If37ctjLQG34li0gQT9xP4XHNIbLMUIC9bgo+BnBfaBXdWdi e/btYhuqEevNROK+hsasp3NwDDYWha/Y4+bXGuUeIE4KStVwZFBMuBXoWT1GKa+c+jGf s+aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oregontracks.org header.s=fm1 header.b=pk3wQDsx; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=rMTZbVGf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu8si717375edb.95.2020.10.15.19.03.02; Thu, 15 Oct 2020 19:03:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oregontracks.org header.s=fm1 header.b=pk3wQDsx; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=rMTZbVGf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389769AbgJPAMj (ORCPT + 99 others); Thu, 15 Oct 2020 20:12:39 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:50267 "EHLO wout4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389671AbgJPAM1 (ORCPT ); Thu, 15 Oct 2020 20:12:27 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id B0CB920D; Thu, 15 Oct 2020 20:12:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 15 Oct 2020 20:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= oregontracks.org; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=fm1; bh=0c/JONLL/FRrSvwQ4PVvmvGdLpt/b1FZX+mwA7CeAjQ=; b=pk3wQ DsxLtW0RrZaGwTiZ2D1i2ovvGHHXoPeYINXKb5VbFynmpO8roft/UCTqFkdkT+jO GRcJ21X+ArcbWjIQ+gZ8lmmA0R3Ev1dV14zGm1GqBN75NMmheqDJ6I+A1u9dft56 SDLrPjq7qpiJ7TejG1aRRX8Grx1UvPxNmx8Z91tLt5KZBzpj4GYsaDfICU9LdBbj JQyeoWPz0vTdKv/6nzfpewyFBGn8iCkZntOE9PydYmSyQZh9O9p9I+OjlJYlAkWY qAw17A9PBXlIUN+ZLEe7Za/3d2rgUtxYDpVO7hxkPV86nIT/MCsbl46AhAl40vL7 EL5dbq7TJP5EHYLAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=0c/JONLL/FRrSvwQ4PVvmvGdLpt/b1FZX+mwA7CeAjQ=; b=rMTZbVGf Edd1vrClHq45ysuYvZtD57GrawYGjXV2ynTkyf0X3vfENn8yWInTY8ug4qs42MSP W/9Hx1M02GbYzq9OUV9V1ywD9PVfgjBANylYGykv1T6zL3Ji44u1F8XtVKw1ZvGp SaMj+o13D6kYz+321eNwz5SQWdPKIRzwrTLq7fdFsKL3K2Cii8YfJpoh14Tai/Zr U1KE5ryZaJy/RTHIYlB8nGCxsiNKJ0NBA15/lxgbqeD9BvxcyYv4kiJL61j9HZv9 Z8/HfrcSsgaBgXdeO7novcCPiVQzQ9hCXeooGrHbuB9g7JuED0ADSoyvJH8L+g+v toX7iWCsBEExMw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrieeggdeffecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefuvggrnhcuggcumfgvlhhlvgihuceoshgvrghnvhhkrdguvghv sehorhgvghhonhhtrhgrtghkshdrohhrgheqnecuggftrfgrthhtvghrnhepkefggeektd dttdeuffffjeeihfetfffghfdugefhvdeuheeuudelheegleevheefnecuffhomhgrihhn pehkvghrnhgvlhdrohhrghenucfkphepvdegrddvtddrudegkedrgeelnecuvehluhhsth gvrhfuihiivgepfeenucfrrghrrghmpehmrghilhhfrhhomhepshgvrghnvhhkrdguvghv sehorhgvghhonhhtrhgrtghkshdrohhrgh X-ME-Proxy: Received: from arch-ashland-svkelley.hsd1.or.comcast.net (c-24-20-148-49.hsd1.or.comcast.net [24.20.148.49]) by mail.messagingengine.com (Postfix) with ESMTPA id 4F3EE306467E; Thu, 15 Oct 2020 20:12:23 -0400 (EDT) From: Sean V Kelley To: bhelgaas@google.com, Jonathan.Cameron@huawei.com, rafael.j.wysocki@intel.com, ashok.raj@intel.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@intel.com, qiuxu.zhuo@intel.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Sean V Kelley Subject: [PATCH v9 06/15] PCI/ERR: Simplify by computing pci_pcie_type() once Date: Thu, 15 Oct 2020 17:11:04 -0700 Message-Id: <20201016001113.2301761-7-seanvk.dev@oregontracks.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016001113.2301761-1-seanvk.dev@oregontracks.org> References: <20201016001113.2301761-1-seanvk.dev@oregontracks.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean V Kelley Instead of calling pci_pcie_type(dev) twice, call it once and save the result. No functional change intended. [bhelgaas: split to separate patch] Link: https://lore.kernel.org/r/20201002184735.1229220-6-seanvk.dev@oregontracks.org Signed-off-by: Sean V Kelley Signed-off-by: Bjorn Helgaas Acked-by: Jonathan Cameron --- drivers/pci/pcie/err.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index 05f61da5ed9d..7a5af873d8bc 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -150,6 +150,7 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, pci_channel_state_t state, pci_ers_result_t (*reset_subordinates)(struct pci_dev *pdev)) { + int type = pci_pcie_type(dev); pci_ers_result_t status = PCI_ERS_RESULT_CAN_RECOVER; struct pci_bus *bus; @@ -157,8 +158,8 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, * Error recovery runs on all subordinates of the first downstream port. * If the downstream port detected the error, it is cleared at the end. */ - if (!(pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT || - pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM)) + if (!(type == PCI_EXP_TYPE_ROOT_PORT || + type == PCI_EXP_TYPE_DOWNSTREAM)) dev = pci_upstream_bridge(dev); bus = dev->subordinate; -- 2.28.0