xen/keyhandler: add missing noreturn attribute

Function `reboot_machine' does not return, but lacks the `noreturn'
attribute.

Functions that never return should be declared with a `noreturn'
attribute.

The lack of `noreturn' causes a violation of MISRA C Rule 17.11 (not
currently accepted in Xen), and also Rule 2.1: "A project shall not
contain unreachable code". Depending on the compiler used and the
compiler optimization used, the lack of `noreturn' might lead to the
presence of unreachable code.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Signed-off-by: Victor Lira <victorm.lira@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Nicola Vetrini authored and Stefano Stabellini committed 2025-06-18 17:40:41 -07:00
1 parent 22650d6054
commit 9ea5d035db
1 file changed
+1 -1
+1 -1
View File
@@ -251,7 +251,7 @@ static void cf_check dump_hwdom_registers(unsigned char key)
}
}
static void cf_check reboot_machine(unsigned char key, bool unused)
static void noreturn cf_check reboot_machine(unsigned char key, bool unused)
{
printk("'%c' pressed -> rebooting machine\n", key);
machine_restart(0);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.