From: <victorm.lira@amd.com>
To: <xen-devel@lists.xenproject.org>
Cc: "Nicola Vetrini" <nicola.vetrini@bugseng.com>,
"Victor Lira" <victorm.lira@amd.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Federico Serafini" <federico.serafini@bugseng.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>
Subject: [PATCH 2/3] xen/arm: add missing noreturn attributes
Date: Wed, 4 Jun 2025 16:49:56 -0700 [thread overview]
Message-ID: <20250604235034.1595881-2-victorm.lira@amd.com> (raw)
In-Reply-To: <20250604235034.1595881-1-victorm.lira@amd.com>
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
The marked functions never return to their caller, but
lack the `noreturn' attribute, therefore causing a violation
of MISRA C Rule 2.1: "A project shall not contain unreachable code".
No functional change.
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Signed-off-by: Victor Lira <victorm.lira@amd.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>
Cc: Michal Orzel <michal.orzel@amd.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien@xen.org>
Cc: Roger Pau Monné <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: Federico Serafini <federico.serafini@bugseng.com>
Cc: Bertrand Marquis <bertrand.marquis@arm.com>
---
xen/arch/arm/efi/efi-boot.h | 2 +-
xen/arch/arm/include/asm/arm64/traps.h | 2 +-
xen/arch/arm/include/asm/processor.h | 2 +-
xen/arch/arm/setup.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index d2a09ad3a1..ee80560e13 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -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();
}
diff --git a/xen/arch/arm/include/asm/arm64/traps.h b/xen/arch/arm/include/asm/arm64/traps.h
index 3be2fa69ee..b7435c6e73 100644
--- a/xen/arch/arm/include/asm/arm64/traps.h
+++ b/xen/arch/arm/include/asm/arm64/traps.h
@@ -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__ */
/*
diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index 9cbc4f9110..92c8bc1a31 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -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);
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 734e23da44..ed72317af3 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -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;
--
2.25.1
next prev parent reply other threads:[~2025-06-04 23:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-04 23:49 [PATCH 1/3] xen/keyhandler: add missing noreturn attribute victorm.lira
2025-06-04 23:49 ` victorm.lira [this message]
2025-06-04 23:49 ` [PATCH 3/3] xen/x86: add missing noreturn attributes victorm.lira
2025-06-05 7:24 ` Jan Beulich
2025-06-05 7:17 ` [PATCH 1/3] xen/keyhandler: add missing noreturn attribute Jan Beulich
2025-06-05 12:22 ` Nicola Vetrini
2025-06-05 12:26 ` Nicola Vetrini
2025-06-05 13:27 ` Jan Beulich
2025-06-06 0:09 ` Stefano Stabellini
2025-06-06 6:47 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250604235034.1595881-2-victorm.lira@amd.com \
--to=victorm.lira@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=federico.serafini@bugseng.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=nicola.vetrini@bugseng.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.