From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 2E86EE99046 for ; Fri, 10 Apr 2026 07:13:42 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fsShN55V7z2yZ6; Fri, 10 Apr 2026 17:13:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1775800251; cv=none; b=ErU7tJ0e/0rx1aVDWI6N9BhfZZAsc6O15T5zOaZ4FvB8t4rI5NJ8n1QqpjiuQCx+NdHyr2BKdgbnpucZz9u8fFdAxs8lgw9cMAAu48vbXnPLVzM+MRmqaP6WA2NyDo9CSRhNZVWlKX59poctmWLnOgsGEYI0zv2wXzfiV8leatInZ1Jo6ehMiGZ5bLoyZjtJmomEx0PGxmnAJRkMQNmsgu66fGGTbhL9X/GfgUNzwstDKm2SRH39Rj5LWJFwVqHMwy/XR1u+H405y2XXL3yPvD5goEMruhQDHaAlKhmX50an3Xlc55ZdwxsB0odUndr4oQHZvn8gAF6l58Cmub0ueA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1775800251; c=relaxed/relaxed; bh=KaVul/RzN8I79K1meFh9mEltVyesCx8sCd2myN4yG/U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Bx5VKF+x3nYses9bpK5/DHab4JRpCf9CxiXFgLeIc+2SDJqc4LWFELeyLTv532NR//iiqo//k5IWUlHthdqmbK4m9fjNGf7oCye8karvwBHfx1K7Ld0FH9K2t+G16L98x29Lsz31KaQhmCUrPQXcwuaxEwxiPyW8n5/uPcwYKdTmZYVr6VDi9OTkoDUNbcBlsDj4sudTDb7EccndfeJVSneG3eL+Wz6vMJxYIHEwLYBEtXnLzSequmt6bRs9X1PqakvpaecXjAqaB4jZzOhTqLtRZBtGsvrOT5vKWqfL019da8nyLkl5AYlUD7R05md/pVSO8oRDh88F0byV51+3Lg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=XSDUxw1+; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=kwilczynski@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=XSDUxw1+; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=kwilczynski@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fsQrq0vrHz2yRl for ; Fri, 10 Apr 2026 15:50:51 +1000 (AEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 8FCA04197B; Fri, 10 Apr 2026 05:50:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47F60C2BCAF; Fri, 10 Apr 2026 05:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775800248; bh=Abe1m1Z8PpNQTng9noxPcdaUTKwIZ1LxfPJE/gyWr4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XSDUxw1+NxDiqCuhMlUnkm5BCNtIis56VRp+6WvylahI9VYpmac8d1PlCroSJIEz/ JSOltyVjwl96pbEdVjhMdigYHBL1v9vvBHjS3ooJl/LjRicWdNKzLPb8mSWzi3iLPJ Eu3iZcSM85jQ39FRl/ciCrflAKsnLw68fGtV6uU6VJjJoRJv3ZUhKPZqfCe2zf94Fo r6zD446KISPFL3h26rx6AyKg9Qni+46BHMPVW1yNlhtItdI8TxlFw6KmlkwX2SLlGK 9SI0SDpn+2h9dGUGJ9HK/J15s2zfk9vQu+QLRaDjQgm5byU3yOPJ9L9/7fDgNrQma9 vdw4rGd4FP3IQ== From: =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= To: Bjorn Helgaas Cc: Bjorn Helgaas , Manivannan Sadhasivam , Lorenzo Pieralisi , Magnus Lindholm , Matt Turner , Richard Henderson , Christophe Leroy , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Dexuan Cui , =?UTF-8?q?Krzysztof=20Ha=C5=82asa?= , Lukas Wunner , "Oliver O'Halloran" , Saurabh Singh Sengar , Shuan He , Srivatsa Bhat , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , linux-pci@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 01/20] PCI/sysfs: Use PCI resource accessor macros Date: Fri, 10 Apr 2026 05:50:21 +0000 Message-ID: <20260410055040.39233-2-kwilczynski@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410055040.39233-1-kwilczynski@kernel.org> References: <20260410055040.39233-1-kwilczynski@kernel.org> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace direct pdev->resource[] accesses with pci_resource_n(), and pdev->resource[].flags accesses with pci_resource_flags(). No functional changes intended. Signed-off-by: Krzysztof WilczyƄski --- drivers/pci/pci-sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 16eaaf749ba9..ad3c17f86c7f 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -177,7 +177,7 @@ static ssize_t resource_show(struct device *dev, struct device_attribute *attr, max = PCI_BRIDGE_RESOURCES; for (i = 0; i < max; i++) { - struct resource *res = &pci_dev->resource[i]; + struct resource *res = pci_resource_n(pci_dev, i); struct resource zerores = {}; /* For backwards compatibility */ @@ -715,7 +715,7 @@ static ssize_t boot_vga_show(struct device *dev, struct device_attribute *attr, return sysfs_emit(buf, "%u\n", (pdev == vga_dev)); return sysfs_emit(buf, "%u\n", - !!(pdev->resource[PCI_ROM_RESOURCE].flags & + !!(pci_resource_flags(pdev, PCI_ROM_RESOURCE) & IORESOURCE_ROM_SHADOW)); } static DEVICE_ATTR_RO(boot_vga); @@ -1108,7 +1108,7 @@ static int pci_mmap_resource(struct kobject *kobj, const struct bin_attribute *a struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj)); int bar = (unsigned long)attr->private; enum pci_mmap_state mmap_type; - struct resource *res = &pdev->resource[bar]; + struct resource *res = pci_resource_n(pdev, bar); int ret; ret = security_locked_down(LOCKDOWN_PCI_ACCESS); @@ -1312,7 +1312,7 @@ static int pci_create_resource_files(struct pci_dev *pdev) retval = pci_create_attr(pdev, i, 0); /* for prefetchable resources, create a WC mappable file */ if (!retval && arch_can_pci_mmap_wc() && - pdev->resource[i].flags & IORESOURCE_PREFETCH) + pci_resource_flags(pdev, i) & IORESOURCE_PREFETCH) retval = pci_create_attr(pdev, i, 1); if (retval) { pci_remove_resource_files(pdev); -- 2.53.0