hulk inclusion category: bugfix bugzilla: 46772 CVE: NA Reference: https://gitee.com/openeuler/kernel/issues/I28HIY
-------------------------------------------------
enable_acpi is declaration as a enumerated type in mpam, where it's also defined as a static inline function in acpi.h, this following compilation error will be triggered if we use their two like this.
In file included from ./include/acpi/acpi_io.h:7:0, from ./include/linux/acpi.h:47, from ./arch/arm64/include/asm/machine_t.h:26, from arch/arm64/kernel/process.c:64: ./arch/arm64/include/asm/acpi.h:82:20: error: ‘enable_acpi’ redeclared as different kind of symbol static inline void enable_acpi(void) ^~~~~~~~~~~ In file included from arch/arm64/kernel/process.c:61:0: ./arch/arm64/include/asm/mpam_sched.h:46:2: note: previous definition of ‘enable_acpi’ was here enable_acpi,
We should rename enable_acpi properly for mpam.
Signed-off-by: Wang ShaoBo bobo.shaobowang@huawei.com --- arch/arm64/include/asm/mpam_sched.h | 6 +++--- arch/arm64/kernel/mpam.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/include/asm/mpam_sched.h b/arch/arm64/include/asm/mpam_sched.h index 350296157087a..ddc7ce3e1a9e1 100644 --- a/arch/arm64/include/asm/mpam_sched.h +++ b/arch/arm64/include/asm/mpam_sched.h @@ -41,9 +41,9 @@ static inline void mpam_sched_in(void) }
enum mpam_enable_type { - enable_denied = 0, - enable_default, - enable_acpi, + MPAM_ENABLE_DENIED = 0, + MPAM_ENABLE_DEFAULT, + MPAM_ENABLE_ACPI, };
extern enum mpam_enable_type __read_mostly mpam_enabled; diff --git a/arch/arm64/kernel/mpam.c b/arch/arm64/kernel/mpam.c index 3f89cec8e2fb1..96f4d013a9034 100644 --- a/arch/arm64/kernel/mpam.c +++ b/arch/arm64/kernel/mpam.c @@ -252,7 +252,7 @@ int __init mpam_force_init(void) { int ret;
- if (mpam_enabled != enable_default) + if (mpam_enabled != MPAM_ENABLE_DEFAULT) return 0;
ret = mpam_nodes_discovery_start(); @@ -1380,9 +1380,9 @@ enum mpam_enable_type __read_mostly mpam_enabled; static int __init mpam_setup(char *str) { if (!strcmp(str, "=acpi")) - mpam_enabled = enable_acpi; + mpam_enabled = MPAM_ENABLE_ACPI; else - mpam_enabled = enable_default; + mpam_enabled = MPAM_ENABLE_DEFAULT; return 1; } __setup("mpam", mpam_setup);