Skip to contentSkip to conversation

s390/kdump: Mark __do_machine_kexec as __noreturn

PATCH New Thorsten Blum 1 participant 3 messages Nov 14, 2025 s390

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 s390/kdump: Mark __do_machine_kexec as __noreturn

__do_machine_kexec() ends by calling the non-returning function disabled_wait() and therefore also never returns. Annotate it with the __noreturn attribute to improve compiler optimizations.

---
Changes in v2:
- Drop the first two patches from the series because store_status() does return to the caller (Heiko)
- Link to v1: https://lore.kernel.org/lkml/[email protected]/

---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/machine_kexec.c +1 -1
index baeb3dcfc1c8..9be6f58a6553 100644
@@ -224,7 +224,7 @@ void machine_crash_shutdown(struct pt_regs *regs)
 /*
  * Do normal kexec
  */
-static void __do_machine_kexec(void *data)
+static void __noreturn __do_machine_kexec(void *data)
 {
 	unsigned long data_mover, entry, diag308_subcode;
 	struct kimage *image = data;
Signature · 1 line
2.51.1
#1 lore raw

PATCH v2 2/3 s390/kdump: Mark __machine_kexec as __noreturn

__machine_kexec() ends by calling the non-returning function __do_machine_kexec() and therefore also never returns. Annotate it with the __noreturn attribute to improve compiler optimizations.

---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/machine_kexec.c +1 -1
index 9be6f58a6553..1d1c709bc088 100644
@@ -248,7 +248,7 @@ static void __noreturn __do_machine_kexec(void *data)
 /*
  * Reset system and call either kdump or normal kexec
  */
-static void __machine_kexec(void *data)
+static void __noreturn __machine_kexec(void *data)
 {
 	pfault_fini();
 	tracing_off();
Signature · 1 line
2.51.1
#2 lore raw

PATCH v2 3/3 s390/kdump: Mark __do_machine_kdump as __noreturn

In reply to Thorsten Blum

__do_machine_kdump() ends by calling the non-returning function disabled_wait() and therefore also never returns. Annotate it with the __noreturn attribute to improve compiler optimizations.

---
 arch/s390/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/machine_kexec.c +1 -1
index 1d1c709bc088..c1103044c647 100644
@@ -45,7 +45,7 @@ extern const unsigned long long relocate_kernel_len;
  * Reset the system, copy boot CPU registers to absolute zero,
  * and jump to the kdump image
  */
-static void __do_machine_kdump(void *data)
+static void __noreturn __do_machine_kdump(void *data)
 {
 	struct kimage *image = data;
 	purgatory_t purgatory;
Signature · 1 line
2.51.1