xen/arm: pci: Narrow scope of file-local symbols

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@amd.com>
Acked-by: Julien Grall <julien@xen.org>
This commit is contained in:
Michal Orzel committed 2026-04-03 08:43:00 +02:00
1 parent 26f023918e
commit 9d9d7586c3
3 files changed
+6 -5

No files matched your search

+2 -2
View File
@@ -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);
}
+3 -2
View File
@@ -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 = {
+1 -1
View File
@@ -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 = {
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.