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 A95A5C83F12 for ; Tue, 29 Aug 2023 16:15:24 +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=sTQOAoRds7BNVla8rVm6wJwuHoAI4deWLuDlfQcbsdM=; b=JeO8R0KIJyxFGxFA9M+S9KGywe 8WZKRXZFIuyzXyFIGY1PQruH4Hsd/oH7Oqn83C9wIRiSfxOlQ6xptdHa1YHr1delMOxRso3HJUorz U8ljK3XqqRtKWy6bgCOyXOxWi5N4oYJL/rIpEYCQ3DDsvtO9OBqr21z3ZviHbqS11ScqeMSnonwKm Pg8zlbd1rJBY2jg3nCntYM6ZrK288r6m6fVW3e8AYg6eFOq+jC3dBpH4Y+A27fGpWUjQxh0o8FNKe 8ggR+RcCiorI0iJkxQZmtTDjDfSz6Np8YDeHYUu/fO9ysVqPeXPvU4LW9lSiG11F668HH4LkFweAP joLUO5zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qb1Mk-00Bq7l-06; Tue, 29 Aug 2023 16:14:54 +0000 Received: from mgamail.intel.com ([192.55.52.93]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qb1Mf-00Bq7L-25 for linux-arm-kernel@lists.infradead.org; Tue, 29 Aug 2023 16:14:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693325689; x=1724861689; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=CWbT+PuWCNmRpPKaOz8yZTIyoxhZcqGd0gZTyF/EEK8=; b=ebgeStFxc/NO7KJvd1/PYg34DR6ZbIMTcZvArQnxyIJhzsg27lIR1UAg DB4biX3u0wfS8EMRHt68fXLR3dguOJJ2pVkqJiByz8u0p3UvPcZhCMC5r MrrnL7nn9orWPf0FUqr0LQVRC+4M1ZnwEFNAPpKn19QR+qixK1736rFHK sOpirP6kzFIi4Og6a/lF+DvhJyX9daMStl7/jGmqnDFN1AcaJ/w8gtyVR YOfC+fe7XQ5ia922o/k6vjFUElRhIBpzwtFEkyEZS6c4Lpxf83f9c1EK1 SMkygR88GN+4EK476tARcWI+ulcKpq/kCE72oZGbmPiWJrtlKIOjQhR+B A==; X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="372822418" X-IronPort-AV: E=Sophos;i="6.02,210,1688454000"; d="scan'208";a="372822418" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2023 09:14:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10817"; a="804178706" X-IronPort-AV: E=Sophos;i="6.02,210,1688454000"; d="scan'208";a="804178706" Received: from tgodea-mobl.ger.corp.intel.com ([10.251.214.174]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2023 09:14:39 -0700 Date: Tue, 29 Aug 2023 19:14:36 +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: Message-ID: <743fadf9-34d9-ca25-bdd6-f69bd922c3ec@linux.intel.com> References: <20230827133705.12991-1-ilpo.jarvinen@linux.intel.com> <20230827133705.12991-8-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1260880413-1693325681=:1757" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230829_091449_783313_496F3C45 X-CRM114-Status: GOOD ( 23.57 ) 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-1260880413-1693325681=:1757 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT 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.) -- i. --8323329-1260880413-1693325681=: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-1260880413-1693325681=:1757--