Skip to content

Commit 0ab7cdd

Browse files
jognesspmladek
authored andcommitted
printk: For @suppress_panic_printk check for other CPU in panic
Currently @suppress_panic_printk is checked along with non-matching @panic_cpu and current CPU. This works because @suppress_panic_printk is only set when panic_in_progress() is true. Rather than relying on the @suppress_panic_printk semantics, use the concise helper function other_cpu_in_progress(). The helper function exists to avoid open coding such tests. Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
1 parent 5113cf5 commit 0ab7cdd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/printk/printk.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,8 +2270,7 @@ asmlinkage int vprintk_emit(int facility, int level,
22702270
if (unlikely(suppress_printk))
22712271
return 0;
22722272

2273-
if (unlikely(suppress_panic_printk) &&
2274-
atomic_read(&panic_cpu) != raw_smp_processor_id())
2273+
if (unlikely(suppress_panic_printk) && other_cpu_in_panic())
22752274
return 0;
22762275

22772276
if (level == LOGLEVEL_SCHED) {

0 commit comments

Comments
 (0)