Message ID | 20240705182311.1968790-2-andrew.cooper3@citrix.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ppc/shutdown: Implement machine_{halt,restart}() | expand |
On 05.07.2024 20:23, Andrew Cooper wrote: > 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 <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com>
diff --git a/xen/common/shutdown.c b/xen/common/shutdown.c index 5f8141edc6b2..cb9c830bbc1d 100644 --- a/xen/common/shutdown.c +++ b/xen/common/shutdown.c @@ -11,7 +11,7 @@ #include <public/sched.h> /* 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) @@ -29,7 +29,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 668aed0be580..c7fa23aec1fe 100644 --- a/xen/include/xen/shutdown.h +++ b/xen/include/xen/shutdown.h @@ -2,11 +2,12 @@ #define __XEN_SHUTDOWN_H__ #include <xen/compiler.h> +#include <xen/types.h> /* 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);
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 <andrew.cooper3@citrix.com> --- CC: Shawn Anastasio <sanastasio@raptorengineering.com> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com> CC: Jan Beulich <JBeulich@suse.com> CC: Stefano Stabellini <sstabellini@kernel.org> CC: Julien Grall <julien@xen.org> --- xen/common/shutdown.c | 4 ++-- xen/include/xen/shutdown.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-)