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

[PATCH 1/3] xen/keyhandler: add missing noreturn attribute


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: <victorm.lira@xxxxxxx>
  • Date: Wed, 4 Jun 2025 16:49:55 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=48VLOy0/b6rx5ed5zZ7/OJCVbc1U+JkkkK8ji4aPVCA=; b=ZSK8gWcZXdPFSeXSIwo+jN87bOaYygS80xw2Hnqi6k+JE7pz9VMH+ABUrkhWAOdik8zf/pUebVdjRk0p+OxYLnmi6cp1AkTBnYlY1PzC+BGpXZ5EUp6IDMDOIjlrZihL3/LVWA4MaasYX+HFrcDnbT3oWpQAPOAizt61+ewxEC0mMrS2oDDZjwxFoSqi3ASTyw/7hCx2lten4MnT/hmBPoUh1Dhpt5Xboo+mWGinn4+lP6dg85aDe+lSnvFtHILPXxM2UZ2UvwbbyvkVZxG+8IL9wu8G5FLXYvYHB2Q+EUSOAOXuZaLS+gjiIvelDNr6hXURuHD9Zz9mjIzPhXLWvQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y+Z56QVzWzuyWC2fIa3gYpM6veo0IEYsHLqTvrkhHP5VIjNLyL/SV7ycBzEPseHdX5iRHJm44bD+V7hx+Ko7uuwEfm2AttpE11JM+F9IkgbJ57nc/42po95UzKfpkGJ3bKxRUaYxmKl+dn1MmD6G/v3spjBsqd/zctB5ZR6kDi9xlZgiBocPuQ+tThQRhsKnny3eXpTQHTvVj4AmLwz/N7oMYbFlf2JCGVJuRUpKHwn9shpNY3a2pN+ycgQhOULvLIl5stYlz5j8eEZb6Hh2K63xgBbuz7g40PB0IEUhAL8Yep0+UF2E2b9eAfM7CnvckDVRvILxu8E0GX+cP2QJeA==
  • Cc: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Victor Lira <victorm.lira@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Anthony PERARD" <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Federico Serafini <federico.serafini@xxxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Wed, 04 Jun 2025 23:51:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>

Function `reboot_machine' does not return, but lacks 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@xxxxxxxxxxx>
Signed-off-by: Victor Lira <victorm.lira@xxxxxxx>
---
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Cc: Michal Orzel <michal.orzel@xxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Julien Grall <julien@xxxxxxx>
Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
Cc: Federico Serafini <federico.serafini@xxxxxxxxxxx>
Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>
---

 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



 


Rackspace

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