[PATCH] x86/boot/compressed: make error() take const char *

From: Reda CHERKAOUI

Date: Wed Feb 18 2026 - 11:04:11 EST


error() does not modify its argument, but it currently takes a non-const
char * which can lead to const-discard warnings when callers pass constant
strings. Make error() take a const char * to match its usage.

Signed-off-by: Reda CHERKAOUI <redacherkaoui67@xxxxxxxxx>
---
arch/x86/boot/compressed/error.c | 2 +-
arch/x86/boot/compressed/error.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/boot/compressed/error.c b/arch/x86/boot/compressed/error.c
index 19a8251de506..091c61999b69 100644
--- a/arch/x86/boot/compressed/error.c
+++ b/arch/x86/boot/compressed/error.c
@@ -14,7 +14,7 @@ void warn(const char *m)
error_putstr("\n\n");
}

-void error(char *m)
+void error(const char *m)
{
warn(m);
error_putstr(" -- System halted");
diff --git a/arch/x86/boot/compressed/error.h b/arch/x86/boot/compressed/error.h
index 31f9e080d61a..ccc292e3c853 100644
--- a/arch/x86/boot/compressed/error.h
+++ b/arch/x86/boot/compressed/error.h
@@ -5,7 +5,7 @@
#include <linux/compiler.h>

void warn(const char *m);
-void error(char *m) __noreturn;
+void error(const char *m) __noreturn;
void panic(const char *fmt, ...) __noreturn __cold;

#endif /* BOOT_COMPRESSED_ERROR_H */
--
2.43.0