xen/arm: add missing noreturn attributes

The marked functions never return to their caller, but lack 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:42 -07:00
1 parent 9ea5d035db
commit f143ff92e4
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -934,7 +934,7 @@ static void __init efi_arch_blexit(void)
efi_bs->FreePool(memmap);
}
static void __init efi_arch_halt(void)
static void noreturn __init efi_arch_halt(void)
{
stop_cpu();
}
+1 -1
View File
@@ -6,7 +6,7 @@ void inject_undef64_exception(struct cpu_user_regs *regs);
void do_sysreg(struct cpu_user_regs *regs,
const union hsr hsr);
void do_bad_mode(struct cpu_user_regs *regs, int reason);
void noreturn do_bad_mode(struct cpu_user_regs *regs, int reason);
#endif /* __ASM_ARM64_TRAPS__ */
/*
+1 -1
View File
@@ -571,7 +571,7 @@ extern register_t __cpu_logical_map[];
#endif
#ifndef __ASSEMBLY__
void panic_PAR(uint64_t par);
void noreturn panic_PAR(uint64_t par);
/* Debugging functions are declared with external linkage to aid development. */
void show_registers(const struct cpu_user_regs *regs);
+1 -1
View File
@@ -63,7 +63,7 @@ bool __read_mostly acpi_disabled;
domid_t __read_mostly max_init_domid;
static __used void init_done(void)
static __used void noreturn init_done(void)
{
int rc;
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.