From 10b9589e6d4dd5e09c3d863bbebd927fe3f9beac Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Fri, 5 Jul 2024 18:59:24 +0100 Subject: [PATCH] xen/shutdown: Fix build issue with shutdown.h on PowerPC The use of bool needs xen/types.h, which shutdown.h picks up by chance in all other architectures. While fixing this, swap u8 for unsigned char in hwdom_shutdown(), and move opt_noreboot into __ro_after_init. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- xen/common/shutdown.c | 4 ++-- xen/include/xen/shutdown.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/common/shutdown.c b/xen/common/shutdown.c index f413f331af..c47341b977 100644 --- a/xen/common/shutdown.c +++ b/xen/common/shutdown.c @@ -12,7 +12,7 @@ #include /* opt_noreboot: If true, machine will need manual reset on error. */ -bool __read_mostly opt_noreboot; +bool __ro_after_init opt_noreboot; boolean_param("noreboot", opt_noreboot); static void noreturn reboot_or_halt(void) @@ -30,7 +30,7 @@ static void noreturn reboot_or_halt(void) } } -void hwdom_shutdown(u8 reason) +void hwdom_shutdown(unsigned char reason) { switch ( reason ) { diff --git a/xen/include/xen/shutdown.h b/xen/include/xen/shutdown.h index 668aed0be5..c7fa23aec1 100644 --- a/xen/include/xen/shutdown.h +++ b/xen/include/xen/shutdown.h @@ -2,11 +2,12 @@ #define __XEN_SHUTDOWN_H__ #include +#include /* opt_noreboot: If true, machine will need manual reset on error. */ extern bool opt_noreboot; -void noreturn hwdom_shutdown(u8 reason); +void noreturn hwdom_shutdown(unsigned char reason); void noreturn machine_restart(unsigned int delay_millisecs); void noreturn machine_halt(void); -- 2.39.5