Skip to contentSkip to conversation

s390/nmi: Annotate s390_handle_damage with __noreturn

PATCH Applied Thorsten Blum 2 participants 2 messages Oct 27, 2025 – Oct 29, 2025 s390

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390/nmi: Annotate s390_handle_damage with __noreturn

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

Remove the unreachable infinite while loop.

---
 arch/s390/kernel/nmi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/s390/kernel/nmi.c +1 -2
index 11f33243a23f..a55abbf65333 100644
@@ -184,7 +184,7 @@ static notrace void nmi_print_info(void)
 	sclp_emergency_printk(message);
 }
 
-static notrace void s390_handle_damage(void)
+static notrace void __noreturn s390_handle_damage(void)
 {
 	struct lowcore *lc = get_lowcore();
 	union ctlreg0 cr0, cr0_new;
@@ -214,7 +214,6 @@ static notrace void s390_handle_damage(void)
 	lc->mcck_new_psw = psw_save;
 	local_ctl_load(0, &cr0.reg);
 	disabled_wait();
-	while (1);
 }
 NOKPROBE_SYMBOL(s390_handle_damage);
 
Signature · 1 line
2.51.0
maintainer Applied
#1 lore raw
Quoted 10 lines · Thorsten Blum

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

Remove the unreachable infinite while loop.

---
 arch/s390/kernel/nmi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Applied, thanks.