All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] xen/keyhandler: add missing noreturn attribute
@ 2025-06-06 21:27 victorm.lira
  2025-06-06 21:27 ` [PATCH v2 2/3] xen/arm: add missing noreturn attributes victorm.lira
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: victorm.lira @ 2025-06-06 21:27 UTC (permalink / raw)
  To: xen-devel
  Cc: Nicola Vetrini, Victor Lira, Andrew Cooper, Anthony PERARD,
	Michal Orzel, Jan Beulich, Julien Grall,
	Roger Pau Monné, Stefano Stabellini, Federico Serafini,
	Bertrand Marquis

From: Nicola Vetrini <nicola.vetrini@bugseng.com>

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>
---
Changes in v2:
- improved commit message
---
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/common/keyhandler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 0bb842ec00..b0a2051408 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -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);
--
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-06-20  6:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-06 21:27 [PATCH v2 1/3] xen/keyhandler: add missing noreturn attribute victorm.lira
2025-06-06 21:27 ` [PATCH v2 2/3] xen/arm: add missing noreturn attributes victorm.lira
2025-06-06 21:27   ` [PATCH v2 3/3] xen/x86: " victorm.lira
2025-06-18  0:48     ` Stefano Stabellini
2025-06-18 15:18     ` Roger Pau Monné
2025-06-18 16:16       ` Nicola Vetrini
2025-06-18 17:25         ` Roger Pau Monné
2025-06-20  6:16         ` Jan Beulich
2025-06-18  0:45   ` [PATCH v2 2/3] xen/arm: " Stefano Stabellini
2025-06-10  8:35 ` [PATCH v2 1/3] xen/keyhandler: add missing noreturn attribute Jan Beulich
2025-06-18  0:41 ` Stefano Stabellini

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.