[Concept,08/26] linux: printk: Fix KERN_* macros for string concatenation

Message ID 20251222115639.700578-9-sjg@u-boot.org
State New
Headers
Series fs: ext4l: Add support for mounting ext4 filesystems (part G) |

Commit Message

Simon Glass Dec. 22, 2025, 11:56 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Change KERN_* macros from empty definitions to empty strings ("").
This fixes string concatenation in printf-style calls like:
  printk(KERN_ERR "message")

Without this fix, KERN_ERR expands to nothing and the string
concatenation fails.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 include/linux/printk.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
  

Patch

diff --git a/include/linux/printk.h b/include/linux/printk.h
index edf149f52c7..00452944c48 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -5,15 +5,15 @@ 
 #include <stdio.h>
 #include <linux/compiler.h>
 
-#define KERN_EMERG
-#define KERN_ALERT
-#define KERN_CRIT
-#define KERN_ERR
-#define KERN_WARNING
-#define KERN_NOTICE
-#define KERN_INFO
-#define KERN_DEBUG
-#define KERN_CONT
+#define KERN_EMERG	""
+#define KERN_ALERT	""
+#define KERN_CRIT	""
+#define KERN_ERR	""
+#define KERN_WARNING	""
+#define KERN_NOTICE	""
+#define KERN_INFO	""
+#define KERN_DEBUG	""
+#define KERN_CONT	""
 
 #define printk(fmt, ...) \
 	printf(fmt, ##__VA_ARGS__)