s390/ipl: Mark store_status as __noreturn
PATCH 1/5 s390/ipl: Mark store_status as __noreturn
store_status() performs a tail call (BR_EX) to the function passed as the first parameter and does not return. Annotate the declaration with the __noreturn attribute to improve compiler optimizations.
--- arch/s390/include/asm/ipl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/ipl.h +1 -1
@@ -164,7 +164,7 @@ enum diag308_rc { };extern int diag308 (unsigned long subcode,void *addr); -extern void store_status (void (*fn)(void *),void *data); +extern void __noreturn store_status (void (*fn)(void *),void *data);extern void lgr_info_log (void );#endif /* _ASM_S390_IPL_H */
Signature · 1 line
2.51.1
PATCH 2/5 s390/kdump: Mark __machine_kdump as __noreturn
__machine_kdump() ends by calling the non-returning function store_status() 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
@@ -77,7 +77,7 @@ static void __do_machine_kdump(void *data)* Start kdump: create a LGR log entry, store status of all CPUs and * branch to __do_machine_kdump. */ -static noinline void __machine_kdump(void *image) +static noinline void __noreturn __machine_kdump(void *image) {struct mcesa *mcesa;union ctlreg2 cr2_old, cr2_new;
Signature · 1 line
2.51.1
PATCH 3/5 s390/kdump: Mark __do_machine_kexec as __noreturn
In reply to Thorsten Blum__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.
--- arch/s390/kernel/machine_kexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/machine_kexec.c +1 -1
@@ -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
PATCH 4/5 s390/kdump: Mark __machine_kexec as __noreturn
In reply to Thorsten Blum__machine_kexec() either ends by calling the non-returning function __machine_kdump() or 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
@@ -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
PATCH 5/5 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
@@ -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
Heiko Carstens
maintainerQuoted 8 lines · Thorsten Blum
store_status()performs a tail call (BR_EX) to the function passed as the first parameter and does not return. Annotate the declaration with the__noreturnattribute to improve compiler optimizations.Signed-off-by Thorsten Blum <[email protected]>--- arch/s390/include/asm/ipl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This doesn't make any sense. If a function is called, which calls another one with a tail call, then _of course_ it looks to the caller like the function returned.
Quoted 5 lines · Heiko Carstens
Quoted 4 lines · Thorsten Blum
store_status()performs a tail call (BR_EX) to the function passed as the first parameter and does not return. Annotate the declaration with the__noreturnattribute to improve compiler optimizations.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Thorsten Blum <[email protected]>---
arch/s390/include/asm/ipl.h| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)This doesn't make any sense. If a function is called, which calls another one with a tail call, then
_ofcourse_it looks to the caller like the function returned.
Hm, I must have misunderstood this comment fromarch/s390/kernel/machine_kexec.c:
/*
* ...
* The call to store_status() will not return.
*/store_status(__do_machine_kdump, image);