Files
Thorsten Blum 9e29ec46f7 riscv: Mark default_power_off() as __noreturn
Since default_power_off() never returns, annotate it with the __noreturn
attribute to improve compiler optimizations.

Signed-off-by: Thorsten Blum <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paul Walmsley <[email protected]>
2026-08-07 19:24:30 -06:00

42 lines
719 B
C

// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2012 Regents of the University of California
*/
#include <linux/efi.h>
#include <linux/reboot.h>
#include <linux/pm.h>
static void __noreturn default_power_off(void)
{
while (1)
wait_for_interrupt();
}
void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL(pm_power_off);
void machine_restart(char *cmd)
{
/*
* UpdateCapsule() depends on the system being reset via ResetSystem().
*/
if (efi_enabled(EFI_RUNTIME_SERVICES))
efi_reboot(reboot_mode, NULL);
do_kernel_restart(cmd);
while (1);
}
void machine_halt(void)
{
do_kernel_power_off();
default_power_off();
}
void machine_power_off(void)
{
do_kernel_power_off();
default_power_off();
}