From patchwork Mon Sep 11 12:53:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13379286 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E690EE57DF for ; Mon, 11 Sep 2023 12:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0h2edUqkFHJYzat8sK8SkETEy4ngE+2yQLTlZkaGPTk=; b=LkACDnuP+Lz3xh GAPNMSnpfn8IzsUUTVcUwo4WrmvpkVqRRc78bgXZbWlgt5zS5vLBrX8GbmlDrJQAbzjeyc1lU8wS7 pe6LGnnO1POWa81MpLIiSq/v1h/G/DoyIcEJdP3kaQYwS4CDQLp/luPvBH105D4ITJ1lR26VjgQLM qWapiazokNeKarGYrsH0kI3MeaMpkJXJx9M/rJHSM4jWJVTBgnXoaeyxXNBSTkiVhrpCLMyOAPIo/ Q0nehf9LDAwixguvdPaSmN+X1gyQvPrGbfe4wszDTPUaWq/MPhP/iwYmIjYNn8YWM5R6C1pJK6X7a jkSQi7zCnK0U0HVJfIGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qfgRG-000WiI-1W; Mon, 11 Sep 2023 12:54:50 +0000 Received: from mgamail.intel.com ([192.55.52.136]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qfgRD-000Wdi-1R for linux-arm-kernel@lists.infradead.org; Mon, 11 Sep 2023 12:54:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694436887; x=1725972887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=icV8SsP9lTlQT1/vuwPuhc7cV1t/gtJOjQvxjYnKJJc=; b=G1dIvOTBrgSZFWWxpdmDDMeOvD/nX0RlC8BmwQlHsZFJmBslmWlZT9jL qifbA/mQj1FPCYf7JWpHatLZYeH5X8BB7V3zLAFFN3g5wwL8uq/BY9D2Y v6xsjuPuBA/SJ/9u+mEl07764CV+zomKs9nZmq0UX5p2RrC1tc7BL+619 T1DjvDDChLfvvGhW8htgM1YqcYpamab+gU2mmo1ipcdiACxhwBpJX39qP SmcI/e05KSMXZlOaKmpMnyBtHlRxNne+3XQCjwex2UylOIp2MP5Vf3bPR Y3X9gQ0/GbmE/7cju0aqLLVJQXqaF57qzdHVxdG6hQyIU0d9RgRl/WFIL w==; X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="357511283" X-IronPort-AV: E=Sophos;i="6.02,244,1688454000"; d="scan'208";a="357511283" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 05:54:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="858304475" X-IronPort-AV: E=Sophos;i="6.02,244,1688454000"; d="scan'208";a="858304475" Received: from mzarkov-mobl3.ger.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.252.36.200]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 05:54:41 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Rob Herring , Bjorn Helgaas , linux-pci@vger.kernel.org, Toan Le , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: 3chas3@gmail.com, brking@us.ibm.com, dalias@libc.org, glaubitz@physik.fu-berlin.de, ink@jurassic.park.msu.ru, jejb@linux.ibm.com, linux-alpha@vger.kernel.org, linux-atm-general@lists.sourceforge.net, linux-scsi@vger.kernel.org, linux-sh@vger.kernel.org, martin.petersen@oracle.com, mattst88@gmail.com, netdev@vger.kernel.org, richard.henderson@linaro.org, ysato@users.sourceforge.jp, =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= Subject: [PATCH v3 5/6] PCI: xgene: Do PCI error check on own line & keep return value Date: Mon, 11 Sep 2023 15:53:53 +0300 Message-Id: <20230911125354.25501-6-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230911125354.25501-1-ilpo.jarvinen@linux.intel.com> References: <20230911125354.25501-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230911_055447_543820_F5ADA4D7 X-CRM114-Status: GOOD ( 13.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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