summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2026-06-12 04:05:38 +0200
committerTom Rini <[email protected]>2026-06-29 15:29:44 -0600
commitd5046398433e48e7b0b664c1ee3e4e2af6f861a8 (patch)
tree571f8cf78a888d523b597261385e62aadb88ad68 /arch
parent4a0990218aa9185c2ccd7986dc1ad14b24aaaa9d (diff)
treewide: Staticize and constify acpi ops
Set the acpi_ops structure as static const where applicable. The The structure is not accessible from outside of drivers and is not going to be modified at runtime. The structure may be unused in a couple of drivers depending on their configuration, mark those sites with __maybe_unused . Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/lib/gic-v2.c2
-rw-r--r--arch/arm/lib/gic-v3-its.c2
-rw-r--r--arch/x86/cpu/apollolake/cpu.c4
-rw-r--r--arch/x86/cpu/apollolake/hostbridge.c2
-rw-r--r--arch/x86/cpu/apollolake/lpc.c2
-rw-r--r--arch/x86/cpu/intel_common/generic_wifi.c2
-rw-r--r--arch/x86/lib/fsp/fsp_graphics.c2
7 files changed, 7 insertions, 9 deletions
diff --git a/arch/arm/lib/gic-v2.c b/arch/arm/lib/gic-v2.c
index b70434a45d4..378bdb54c89 100644
--- a/arch/arm/lib/gic-v2.c
+++ b/arch/arm/lib/gic-v2.c
@@ -38,7 +38,7 @@ static int acpi_gicv2_fill_madt(const struct udevice *dev, struct acpi_ctx *ctx)
return 0;
}
-static struct acpi_ops gic_v2_acpi_ops = {
+static const struct acpi_ops gic_v2_acpi_ops = {
.fill_madt = acpi_gicv2_fill_madt,
};
#endif
diff --git a/arch/arm/lib/gic-v3-its.c b/arch/arm/lib/gic-v3-its.c
index d11a1ea436e..064b93b2aa1 100644
--- a/arch/arm/lib/gic-v3-its.c
+++ b/arch/arm/lib/gic-v3-its.c
@@ -197,7 +197,7 @@ static int acpi_gicv3_fill_madt(const struct udevice *dev, struct acpi_ctx *ctx)
return 0;
}
-struct acpi_ops gic_v3_acpi_ops = {
+static const struct acpi_ops gic_v3_acpi_ops = {
.fill_madt = acpi_gicv3_fill_madt,
};
#endif
diff --git a/arch/x86/cpu/apollolake/cpu.c b/arch/x86/cpu/apollolake/cpu.c
index f480bb1d8c3..d1f592ec57e 100644
--- a/arch/x86/cpu/apollolake/cpu.c
+++ b/arch/x86/cpu/apollolake/cpu.c
@@ -171,11 +171,9 @@ static int cpu_apl_probe(struct udevice *dev)
return 0;
}
-#ifdef CONFIG_ACPIGEN
-struct acpi_ops apl_cpu_acpi_ops = {
+static const struct acpi_ops __maybe_unused apl_cpu_acpi_ops = {
.fill_ssdt = acpi_cpu_fill_ssdt,
};
-#endif
static const struct cpu_ops cpu_x86_apl_ops = {
.get_desc = cpu_x86_get_desc,
diff --git a/arch/x86/cpu/apollolake/hostbridge.c b/arch/x86/cpu/apollolake/hostbridge.c
index 284f16cfd91..360d091121c 100644
--- a/arch/x86/cpu/apollolake/hostbridge.c
+++ b/arch/x86/cpu/apollolake/hostbridge.c
@@ -366,7 +366,7 @@ ulong sa_get_tseg_base(struct udevice *dev)
return sa_read_reg(dev, TSEG);
}
-struct acpi_ops apl_hostbridge_acpi_ops = {
+static const struct acpi_ops __maybe_unused apl_hostbridge_acpi_ops = {
.get_name = apl_acpi_hb_get_name,
#if CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE)
.write_tables = apl_acpi_hb_write_tables,
diff --git a/arch/x86/cpu/apollolake/lpc.c b/arch/x86/cpu/apollolake/lpc.c
index f34c199bf73..008c4dc0037 100644
--- a/arch/x86/cpu/apollolake/lpc.c
+++ b/arch/x86/cpu/apollolake/lpc.c
@@ -119,7 +119,7 @@ static int apl_acpi_lpc_get_name(const struct udevice *dev, char *out_name)
return acpi_copy_name(out_name, "LPCB");
}
-struct acpi_ops apl_lpc_acpi_ops = {
+static const struct acpi_ops __maybe_unused apl_lpc_acpi_ops = {
.get_name = apl_acpi_lpc_get_name,
#ifdef CONFIG_GENERATE_ACPI_TABLE
.write_tables = intel_southbridge_write_acpi_tables,
diff --git a/arch/x86/cpu/intel_common/generic_wifi.c b/arch/x86/cpu/intel_common/generic_wifi.c
index 75fa4e01d8a..1a24c10ab0b 100644
--- a/arch/x86/cpu/intel_common/generic_wifi.c
+++ b/arch/x86/cpu/intel_common/generic_wifi.c
@@ -102,7 +102,7 @@ static int intel_wifi_acpi_fill_ssdt(const struct udevice *dev,
return 0;
}
-struct acpi_ops wifi_acpi_ops = {
+static const struct acpi_ops wifi_acpi_ops = {
.fill_ssdt = intel_wifi_acpi_fill_ssdt,
};
diff --git a/arch/x86/lib/fsp/fsp_graphics.c b/arch/x86/lib/fsp/fsp_graphics.c
index ad25020086c..d425e80760b 100644
--- a/arch/x86/lib/fsp/fsp_graphics.c
+++ b/arch/x86/lib/fsp/fsp_graphics.c
@@ -150,7 +150,7 @@ static int fsp_video_acpi_write_tables(const struct udevice *dev,
}
#endif
-struct acpi_ops fsp_video_acpi_ops = {
+static const struct acpi_ops __maybe_unused fsp_video_acpi_ops = {
#ifdef CONFIG_INTEL_GMA_ACPI
.write_tables = fsp_video_acpi_write_tables,
#endif