Skip to content

Commit 505a27a

Browse files
jognesspmladek
authored andcommitted
printk: console: remove unnecessary safe buffer usage
Upon registering a console, safe buffers are activated when setting up the sequence number to replay the log. However, these are already protected by @console_sem and @syslog_lock. Remove the unnecessary safe buffer usage. Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a4f9876 commit 505a27a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

kernel/printk/printk.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2967,9 +2967,7 @@ void register_console(struct console *newcon)
29672967
/*
29682968
* console_unlock(); will print out the buffered messages
29692969
* for us.
2970-
*/
2971-
printk_safe_enter_irqsave(flags);
2972-
/*
2970+
*
29732971
* We're about to replay the log buffer. Only do this to the
29742972
* just-registered console to avoid excessive message spam to
29752973
* the already-registered consoles.
@@ -2982,11 +2980,9 @@ void register_console(struct console *newcon)
29822980
exclusive_console_stop_seq = console_seq;
29832981

29842982
/* Get a consistent copy of @syslog_seq. */
2985-
raw_spin_lock(&syslog_lock);
2983+
raw_spin_lock_irqsave(&syslog_lock, flags);
29862984
console_seq = syslog_seq;
2987-
raw_spin_unlock(&syslog_lock);
2988-
2989-
printk_safe_exit_irqrestore(flags);
2985+
raw_spin_unlock_irqrestore(&syslog_lock, flags);
29902986
}
29912987
console_unlock();
29922988
console_sysfs_notify();

0 commit comments

Comments
 (0)