[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] xen/arm: pci: Narrow scope of file-local symbols


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 1 Apr 2026 16:58:15 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SILGjUjbSSooX9tKAJTxY2XSLgszRtPxBBJmqIQCNh4=; b=pozuB6RQieA01K8G53fPmMrNLYuC937W2LVkf4CcisdubX5lR2+igvVGVdJ+vZeLnPW/fCDWrofUzrd+gzs7u56VespLACXoicjryXWjTJxz/W1bAJB7mHnH+8sf40DtfKd0kq7XYvaKlZUIGygbdKWEBx9KwbAXoGM//HJWMW3P+ojmKakQ7QU5nBSqWDlhvwD+8YLwvaSVIKz4WLLk+QPRWYY+z3SrUS6HHhyyAF68R3Z9kkO3H12rN6oq/6cij6hslct/mYIPr6BBZcmI6xz+ayUpCF8uIMUj18Dw+SfpMiMyce9YH7AzYob86swm4izJrEa3mpQgQLNh99+Q8Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FKVF4993NQdzmJ4lL4J5vlfiIB5Ycl+sljEGTi23OFAPbrF2AI24Mk4hKi29or1DIKAXz5WiSKoK4OYegEoDpC+EJvMv0Zid3pn03qd6irPEAZo/5/A4AtaWIaJ+d0+8uC9XaztqrXw5x+YDdTPtSUt13av6TDi4gVdTririI9MDN44VcO4zUdaqsqRqovDyLmP2YYwwTTIVD09zXHz+LJD8zsWLLdf7rnXuopltvIeS3+Up4NyajdkcvMp8vJ+gtYqCXJmPR2XoyeYPsj5Bd62rF/8gd8wQH/wOLpPKNW8XYaSxILjVaxptSFzELy/2sJ1ZANFlcV8yROoSrwONtA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Mykyta Poturai <mykyta_poturai@xxxxxxxx>
  • Delivery-date: Wed, 01 Apr 2026 14:58:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Make pci_alloc_host_bridge() and pci_add_host_bridge() in
pci-host-common.c, rcar4_pcie_ops and rcar4_pcie_child_ops in
pci-host-rcar4.c, and nwl_pcie_ops in pci-host-zynqmp.c static, as
they are only used within their respective translation units.

Also include pci-host-rcar4.h in pci-host-rcar4.c so that the
declarations of its externally visible functions are visible at the
point of definition.

This resolves MISRA C Rule 8.4 violations.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/pci/pci-host-common.c | 4 ++--
 xen/arch/arm/pci/pci-host-rcar4.c  | 5 +++--
 xen/arch/arm/pci/pci-host-zynqmp.c | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/pci/pci-host-common.c 
b/xen/arch/arm/pci/pci-host-common.c
index 487c545f3a26..9060afc14d93 100644
--- a/xen/arch/arm/pci/pci-host-common.c
+++ b/xen/arch/arm/pci/pci-host-common.c
@@ -158,7 +158,7 @@ err_exit:
     return NULL;
 }
 
-struct pci_host_bridge *pci_alloc_host_bridge(void)
+static struct pci_host_bridge *pci_alloc_host_bridge(void)
 {
     struct pci_host_bridge *bridge = xzalloc(struct pci_host_bridge);
 
@@ -170,7 +170,7 @@ struct pci_host_bridge *pci_alloc_host_bridge(void)
     return bridge;
 }
 
-void pci_add_host_bridge(struct pci_host_bridge *bridge)
+static void pci_add_host_bridge(struct pci_host_bridge *bridge)
 {
     list_add_tail(&bridge->node, &pci_host_bridges);
 }
diff --git a/xen/arch/arm/pci/pci-host-rcar4.c 
b/xen/arch/arm/pci/pci-host-rcar4.c
index 9290c6cac5d3..e1e8eb0ee1f9 100644
--- a/xen/arch/arm/pci/pci-host-rcar4.c
+++ b/xen/arch/arm/pci/pci-host-rcar4.c
@@ -13,6 +13,7 @@
 #include <asm/pci.h>
 
 #include "pci-designware.h"
+#include "pci-host-rcar4.h"
 
 #define RCAR4_DWC_VERSION       0x520A
 
@@ -61,7 +62,7 @@ static int __init rcar4_child_cfg_reg_index(struct 
dt_device_node *np)
 }
 
 /* ECAM ops */
-const struct pci_ecam_ops rcar4_pcie_ops = {
+static const struct pci_ecam_ops rcar4_pcie_ops = {
     .bus_shift  = 20,
     .cfg_reg_index = rcar4_cfg_reg_index,
     .pci_ops    = {
@@ -73,7 +74,7 @@ const struct pci_ecam_ops rcar4_pcie_ops = {
     }
 };
 
-const struct pci_ecam_ops rcar4_pcie_child_ops = {
+static const struct pci_ecam_ops rcar4_pcie_child_ops = {
     .bus_shift  = 20,
     .cfg_reg_index = rcar4_child_cfg_reg_index,
     .pci_ops    = {
diff --git a/xen/arch/arm/pci/pci-host-zynqmp.c 
b/xen/arch/arm/pci/pci-host-zynqmp.c
index 2c4afa7a19d2..2d98b0069647 100644
--- a/xen/arch/arm/pci/pci-host-zynqmp.c
+++ b/xen/arch/arm/pci/pci-host-zynqmp.c
@@ -27,7 +27,7 @@ static int __init nwl_cfg_reg_index(struct dt_device_node *np)
 }
 
 /* ECAM ops */
-const struct pci_ecam_ops nwl_pcie_ops = {
+static const struct pci_ecam_ops nwl_pcie_ops = {
     .bus_shift  = 20,
     .cfg_reg_index = nwl_cfg_reg_index,
     .pci_ops    = {
-- 
2.43.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.