mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-12-22 18:47:06 +01:00
printk: console_is_usable: use console_srcu_read_flags
All users of console_is_usable() are SRCU iterators. Use the appropriate wrapper function to locklessly read the flags. Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20221116162152.193147-18-john.ogness@linutronix.de
This commit is contained in:
parent
eb7f1ed250
commit
12f1da5fc4
|
|
@ -2709,11 +2709,13 @@ static bool abandon_console_lock_in_panic(void)
|
||||||
* Check if the given console is currently capable and allowed to print
|
* Check if the given console is currently capable and allowed to print
|
||||||
* records.
|
* records.
|
||||||
*
|
*
|
||||||
* Requires the console_lock.
|
* Requires the console_srcu_read_lock.
|
||||||
*/
|
*/
|
||||||
static inline bool console_is_usable(struct console *con)
|
static inline bool console_is_usable(struct console *con)
|
||||||
{
|
{
|
||||||
if (!(con->flags & CON_ENABLED))
|
short flags = console_srcu_read_flags(con);
|
||||||
|
|
||||||
|
if (!(flags & CON_ENABLED))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!con->write)
|
if (!con->write)
|
||||||
|
|
@ -2724,8 +2726,7 @@ static inline bool console_is_usable(struct console *con)
|
||||||
* allocated. So unless they're explicitly marked as being able to
|
* allocated. So unless they're explicitly marked as being able to
|
||||||
* cope (CON_ANYTIME) don't call them until this CPU is officially up.
|
* cope (CON_ANYTIME) don't call them until this CPU is officially up.
|
||||||
*/
|
*/
|
||||||
if (!cpu_online(raw_smp_processor_id()) &&
|
if (!cpu_online(raw_smp_processor_id()) && !(flags & CON_ANYTIME))
|
||||||
!(con->flags & CON_ANYTIME))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user