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 48104C83F12 for ; Tue, 29 Aug 2023 16:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:Message-ID:In-Reply-To:Subject:cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qIfMPqCWUCdG3tdd9Ht99YtVv+PcdaMDI8gns6yfqTg=; b=yr9X1EUNwbfxVlKD3p5nHx4VRc dzcaRjZnGyd05D2vzGQs7DHBtslhPF3d15R08aSZh41Fm/kB2tu0jNNEjte6nEsmuSNY4NN3SsX+G gAmKdem8Uztf41W6pgFJwDicXSswfcLmWpDscT+5lfsBPTK7Y7v/J4qj9l/FNrt/9vD4WgvOM+F3p mrfYhdVxsj3a+rM0QjSYGyHzf8isRE6QUZ4tEeabsmWIwmv8o2ShSF+VPWaePPpWCdiBHEfNLidiC jRr86jyvm6PS95Ily6TaDOT0ap3bQAIBmFns6a3CDv/fenltS7IqVlxcz8ZjeBPtG8qR8r6YN08xO /hC2MN6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qb1Vd-00BqsP-2i; Tue, 29 Aug 2023 16:24:05 +0000 Received: from mgamail.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qb1Vb-00Bqrw-2K for linux-arm-kernel@lists.infradead.org; Tue, 29 Aug 2023 16:24:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693326243; x=1724862243; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=Q0QB0bTU4rFXo4+LlKiDQejCgiGZ6OUh6E4S3vd8bQo=; b=Uz9gwS9PYQ0ihFro1L7dEkUI0eMBiSJe0kjVTTMiK+znEJgYz81dL8H4 qEOzZnK7l4fqpZKQ1Sszp9/ZSf54TiHLgh6HIEC23drcRnwDyVlz3vFPE e7k5wGsJ+3+nqVjw7x/SAEXs4OmDnTjNuyFYtDT6zU3yucHupmT9pvEHe bYOcGLjFcgz3VR9PZDB7e5Ob2+XmkBCCBmXBY64i5rKy9u6oW7LXwuYT2 nXmB4W5Edo8NPgI33B/ZxsxyqEg7bDDiGRsnqLh4Bh1zx2zMYmTChheey /kqXjQ6Pir0SKLRwR/XrcK2VyOB15tstozfea0wL0uYmAO4EeYW21MSEr A==; X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="355740022" X-IronPort-AV: E=Sophos;i="6.02,210,1688454000"; d="scan'208";a="355740022" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2023 09:24:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="688562707" X-IronPort-AV: E=Sophos;i="6.02,210,1688454000"; d="scan'208";a="688562707" Received: from tgodea-mobl.ger.corp.intel.com ([10.251.214.174]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2023 09:23:55 -0700 Date: Tue, 29 Aug 2023 19:23:52 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Rob Herring cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Andi Shyti , =?ISO-8859-15?Q?Philippe_Mathieu-Daud=E9?= , Toan Le , Lorenzo Pieralisi , =?ISO-8859-2?Q?Krzysztof_Wilczy=F1ski?= , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, LKML Subject: Re: [PATCH v2 7/8] PCI: xgene: Do PCI error check on own line In-Reply-To: <743fadf9-34d9-ca25-bdd6-f69bd922c3ec@linux.intel.com> Message-ID: <31622354-2510-d942-ebf6-59bd1d44f868@linux.intel.com> References: <20230827133705.12991-1-ilpo.jarvinen@linux.intel.com> <20230827133705.12991-8-ilpo.jarvinen@linux.intel.com> <743fadf9-34d9-ca25-bdd6-f69bd922c3ec@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1634065993-1693326238=:1757" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230829_092403_776246_D1CB574A X-CRM114-Status: GOOD ( 27.06 ) 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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1634065993-1693326238=:1757 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 29 Aug 2023, Ilpo Järvinen wrote: > On Tue, 29 Aug 2023, Rob Herring wrote: > > > On Sun, Aug 27, 2023 at 8:37 AM Ilpo Järvinen > > wrote: > > > > > > Instead of a if condition with a line split, use the usual error > > > handling pattern with a separate variable to improve readability. > > > > > > No functional changes intended. > > > > > > Signed-off-by: Ilpo Järvinen > > > --- > > > drivers/pci/controller/pci-xgene.c | 5 +++-- > > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c > > > index 887b4941ff32..b7f338de160b 100644 > > > --- a/drivers/pci/controller/pci-xgene.c > > > +++ b/drivers/pci/controller/pci-xgene.c > > > @@ -163,9 +163,10 @@ 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) > > > + ret = pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val); > > > + if (ret != PCIBIOS_SUCCESSFUL) > > > > Long term I think we want to replace these error codes with standard > > linux ones. > > This series is preparatory work for this very goal you stated! > > > As PCIBIOS_SUCCESSFUL is 0, I would change this to just: > > > > if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val)) > > return PCIBIOS_DEVICE_NOT_FOUND; > > I'm not so sure about this suggestion as it will overwrite the original > error code (like the current approach unfortunately also does). To me it > would seem more appropriate is to return the original error code instead. > But more discussion is needed before making such changes to values these > functions return. (And there are plenty of similar examples besides this > one.) Actually, it looks in this case I could do that transformation safely now since pci_generic_config_read32() can only return either PCIBIOS_DEVICE_NOT_FOUND or PCIBIOS_SUCCESSFUL so it won't alter anything. -- i. --8323329-1634065993-1693326238=:1757 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --8323329-1634065993-1693326238=:1757--