Skip to contentSkip to conversation

arch/x86: add __noreturn __cold to fortify_panic()

PATCH In review Joey Pabalinas 2 participants 3 messages Jan 1, 2018 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/x86: add __noreturn __cold to fortify_panic()

Definition of fortify_panic() doesn't match the declaration in include/linux/string.h. Add the missing __noreturn __cold attributes to fortify_panic().

---
 arch/x86/boot/compressed/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/boot/compressed/misc.c +1 -1
index 98761a1576ceb5c21b..707cf3f339e37f7f8c 100644
@@ -428,7 +428,7 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
 	return output;
 }
 
-void fortify_panic(const char *name)
+void __noreturn __cold fortify_panic(const char *name)
 {
 	error("detected buffer overflow");
 }
Signature · 1 line
2.15.1
#1 lore raw
Quoted 3 lines · Joey Pabalinas

Definition of fortify_panic() doesn't match the declaration in include/linux/string.h. Add the missing __noreturn __cold attributes to fortify_panic().

This should not be necessary as the prototype
has those attributes.

Otherwise, all the __printf attributes would
also have to be added to the definitions and
not the just the declarations.

Quoted 18 lines
---
 arch/x86/boot/compressed/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/boot/compressed/misc.c +1 -1
index 98761a1576ceb5c21b..707cf3f339e37f7f8c 100644
@@ -428,7 +428,7 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
 	return output;
 }
 
-void fortify_panic(const char *name)
+void __noreturn __cold fortify_panic(const char *name)
 {
 	error("detected buffer overflow");
 }
#2 lore raw
Quoted 6 lines · Joe Perches

This should not be necessary as the prototype
has those attributes.

Otherwise, all the __printf attributes would
also have to be added to the definitions and
not the just the declarations.

Ah I see, gotcha.

Signature · 1 line
Joey Pabalinas