[Devel] [RFC 29/54] printk: fix CONFIG_VE=n build

Eva Kurchatova eva.kurchatova at virtuozzo.com
Wed Apr 29 22:58:29 MSK 2026


Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
---
 kernel/printk/printk.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 68d82ff5a1fa..11e109e204b6 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -683,6 +683,7 @@ static void append_char(char **pp, char *e, char c)
 		*(*pp)++ = c;
 }
 
+#ifdef CONFIG_VE
 static inline u64 ve_timens_add_boottime_ns(u64 nsec)
 {
 	struct time_namespace *ve_time_ns;
@@ -701,6 +702,7 @@ static inline u64 ve_timens_add_boottime_ns(u64 nsec)
 
 	return nsec;
 }
+#endif
 
 static ssize_t info_print_ext_header(char *buf, size_t size,
 				     struct printk_info *info)
@@ -715,9 +717,11 @@ static ssize_t info_print_ext_header(char *buf, size_t size,
 #else
 	caller[0] = '\0';
 #endif
-
+#ifdef CONFIG_VE
 	/* shift the timestamp on the Container uptime value */
 	ts_usec = ve_timens_add_boottime_ns(ts_usec);
+#endif
+
 	do_div(ts_usec, 1000);
 
 	return scnprintf(buf, size, "%u,%llu,%llu,%c%s;",
@@ -1415,10 +1419,10 @@ static size_t print_syslog(unsigned int level, char *buf)
 static size_t print_time(u64 ts, char *buf)
 {
 	unsigned long rem_nsec;
-
+#ifdef CONFIG_VE
 	/* shift the timestamp on the Container uptime value */
 	ts = ve_timens_add_boottime_ns(ts);
-
+#endif
 	rem_nsec = do_div(ts, 1000000000);
 
 	return sprintf(buf, "[%5lu.%06lu]",
-- 
2.54.0



More information about the Devel mailing list