[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] xen: add missing noreturn attribute


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Thu, 24 Jul 2025 22:53:45 +0000
  • Accept-language: en-US, uk-UA, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JktNGlsRdbZuYOiRYkCgihM12W2DpS5FTTNVT/9bP5E=; b=S+oty9bL+fSrgcJQALXQNZ7xqh9TvkFbZ/rfWENEgvZ7qKxsNsj8POHJcU/t9JeUMSVAko9qUAc9NywufGIfFLdz388OlSNCe8udZNKyx3cvAmJa+m4wHgtX5Vb6hYQ9FSmJr8k9ZXJA/ZpapPydd1M5WP9j4AVNOdYe48dl0kdo8+ZpGFhT3htIdoz9XDjKjRN0sH2PSiHGV8btjx+0Jb75irQZWtjxX63dIR+lvMIH0LnT4f+1tb4ExES2L/L5puvCgrarJ/qSQ1rQFZsozfPE6eg9m1Q8yNvqVAPWbn3Yrd9iVqwF9B94g/bKoaj12gfgNrx1E8jMwxso+mcC3Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bah7hJ+SAA3Kso/j8HGYhPzeq9c8qiUqTle2BIwNWa/zKdvPC6GmaJphEjKhQ3zA8J0oxEgECZl3g43MQCrbkxQATDT/O+bXJ+P0vtGeYLuX1GOZCYgHwOSZpVM97D0GDDMVcqUdW/FKi3OveP5vLKDQJjITDy0tDD/0494n5LOQDWuLqU5ifa8QbYT8mEXHiYkI6H76VWIJmnC6O0E22NO7ys1jmsxlV58DFijvh0rSjbTIbWQ0cvvU+x9GpiVoupKkJwe5viRr6DcVjntg8TISeWd28zVSBBfRB/p9k8y9AoOCoW2Tf5zNScvp4ql89+3qbC23/GVPIMX4luK8XA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Thu, 24 Jul 2025 22:53:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb/O3P1WRCmQlwAU2FDpmGMEvRXg==
  • Thread-topic: [PATCH] xen: add missing noreturn attribute

These functions never return to their caller,
causing a violation of MISRA C Rule 2.1:
"A project shall not contain unreachable code".
Add the `noreturn' attribute to fix this.

No functional changes.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
 xen/arch/arm/domain.c  | 2 +-
 xen/arch/arm/setup.c   | 2 +-
 xen/arch/arm/smpboot.c | 2 +-
 xen/common/efi/boot.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 79a144e61b..310c578909 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -298,7 +298,7 @@ static void schedule_tail(struct vcpu *prev)
 extern void noreturn return_to_new_vcpu32(void);
 extern void noreturn return_to_new_vcpu64(void);
 
-static void continue_new_vcpu(struct vcpu *prev)
+static void noreturn continue_new_vcpu(struct vcpu *prev)
 {
     current->arch.actlr = READ_SYSREG(ACTLR_EL1);
     processor_vcpu_initialise(current);
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 27bd3f5a6e..bb35afe56c 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -306,7 +306,7 @@ void __init init_pdx(void)
 size_t __read_mostly dcache_line_bytes;
 
 /* C entry point for boot CPU */
-void asmlinkage __init start_xen(unsigned long fdt_paddr)
+void asmlinkage __init noreturn start_xen(unsigned long fdt_paddr)
 {
     size_t fdt_size;
     const char *cmdline;
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 73de7503e9..7f3cfa812e 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -315,7 +315,7 @@ smp_prepare_cpus(void)
 }
 
 /* Boot the current CPU */
-void asmlinkage start_secondary(void)
+void asmlinkage noreturn start_secondary(void)
 {
     unsigned int cpuid = init_data.cpuid;
 
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index df29444220..4b60bd719e 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -285,7 +285,7 @@ static bool __init match_guid(const EFI_GUID *guid1, const 
EFI_GUID *guid2)
 }
 
 /* generic routine for printing error messages */
-static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
+static void __init noreturn PrintErrMesg(const CHAR16 *mesg, EFI_STATUS 
ErrCode)
 {
     StdOut = StdErr;
     PrintErr(mesg);
-- 
2.43.0



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.