lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230911125354.25501-6-ilpo.jarvinen@linux.intel.com>
Date:   Mon, 11 Sep 2023 15:53:53 +0300
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     Rob Herring <robh@...nel.org>, Bjorn Helgaas <helgaas@...nel.org>,
        linux-pci@...r.kernel.org, Toan Le <toan@...amperecomputing.com>,
        Lorenzo Pieralisi <lpieralisi@...nel.org>,
        Krzysztof Wilczyński <kw@...ux.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:     3chas3@...il.com, brking@...ibm.com, dalias@...c.org,
        glaubitz@...sik.fu-berlin.de, ink@...assic.park.msu.ru,
        jejb@...ux.ibm.com, linux-alpha@...r.kernel.org,
        linux-atm-general@...ts.sourceforge.net,
        linux-scsi@...r.kernel.org, linux-sh@...r.kernel.org,
        martin.petersen@...cle.com, mattst88@...il.com,
        netdev@...r.kernel.org, richard.henderson@...aro.org,
        ysato@...rs.sourceforge.jp,
        Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: [PATCH v3 5/6] PCI: xgene: Do PCI error check on own line & keep return value

Instead of a if condition with a line split, use the usual error
handling pattern with a separate variable to improve readability.

pci_generic_config_read32() already returns either PCIBIOS_SUCCESSFUL
or PCIBIOS_DEVICE_NOT_FOUND so it is enough to simply return its
return value when ret != PCIBIOS_SUCCESSFUL.

No functional changes intended.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
---
 drivers/pci/controller/pci-xgene.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c
index 887b4941ff32..8e457fa450a2 100644
--- a/drivers/pci/controller/pci-xgene.c
+++ b/drivers/pci/controller/pci-xgene.c
@@ -163,10 +163,11 @@ static int xgene_pcie_config_read32(struct pci_bus *bus, unsigned int devfn,
 				    int where, int size, u32 *val)
 {
 	struct xgene_pcie *port = pcie_bus_to_port(bus);
+	int ret;
 
-	if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val) !=
-	    PCIBIOS_SUCCESSFUL)
-		return PCIBIOS_DEVICE_NOT_FOUND;
+	ret = pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val);
+	if (ret != PCIBIOS_SUCCESSFUL)
+		return ret;
 
 	/*
 	 * The v1 controller has a bug in its Configuration Request Retry
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ