From b0a5594693fcb167cb7d2c1e8cdfd4b3ff149ad0 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Wed, 9 Mar 2022 17:25:18 +0100 Subject: [PATCH] say: simplify for newer kernels --- kernel/brick_say.c | 14 ++++++++++---- kernel/compat.h | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/kernel/brick_say.c b/kernel/brick_say.c index f6de0795..011849a1 100644 --- a/kernel/brick_say.c +++ b/kernel/brick_say.c @@ -625,7 +625,10 @@ void brick_say_to(struct say_channel *ch, int class, bool dump, const char *pref if (likely(class >= 0 && class < MAX_SAY_CLASS)) { wait_channel(ch, class); spin_lock_irqsave(&ch->ch_lock[class], flags); - +#ifdef MARS_OLD_SAY_REPORTING /* to disappear */ + /* No longer print the same info twice during the lock. + * Anyway, this code should vanish some day. + */ _say(ch, class, NULL, true, "%lld.%09ld %lld.%09ld %s %s[%d] %s:%d %s(): ", (s64)s_now.tv_sec, s_now.tv_nsec, @@ -634,7 +637,7 @@ void brick_say_to(struct say_channel *ch, int class, bool dump, const char *pref current->comm, (int)smp_processor_id(), file, line, func); - +#endif va_start(args, fmt); _say(ch, class, args, false, fmt); va_end(args); @@ -647,7 +650,10 @@ void brick_say_to(struct say_channel *ch, int class, bool dump, const char *pref if (likely(ch)) { wait_channel(ch, SAY_TOTAL); spin_lock_irqsave(&ch->ch_lock[SAY_TOTAL], flags); - +#ifdef MARS_OLD_SAY_REPORTING /* to disappear */ + /* No longer print the same info twice during the lock. + * Anyway, this code should vanish some day. + */ _say(ch, SAY_TOTAL, NULL, true, "%lld.%09ld %lld.%09ld %s_%-5s %s %s[%d] %s:%d %s(): ", (s64)s_now.tv_sec, s_now.tv_nsec, @@ -657,7 +663,7 @@ void brick_say_to(struct say_channel *ch, int class, bool dump, const char *pref current->comm, (int)smp_processor_id(), file, line, func); - +#endif va_start(args, fmt); _say(ch, SAY_TOTAL, args, false, fmt); va_end(args); diff --git a/kernel/compat.h b/kernel/compat.h index 214c0af8..a1a5d820 100644 --- a/kernel/compat.h +++ b/kernel/compat.h @@ -138,6 +138,8 @@ extern int __oldcompat_unlink( #if !defined(GENHD_FL_MEDIA_CHANGE_NOTIFY) || \ defined(IOCB_WAITQ) #define MARS_NEW_BLK_ALLOC_QUEUE +#else +#define MARS_OLD_SAY_REPORTING /* to disappear */ #endif /* Detect upstream commits