Re: [PATCH printk v4 4/8] printk: nbcon: Use @reason instead of global variable to check flush policy

From: John Ogness

Date: Thu Nov 26 2026 - 04:53:09 EST


On 2026-11-24, Petr Mladek <pmladek@xxxxxxxx> wrote:
>> --- a/kernel/printk/nbcon.c
>> +++ b/kernel/printk/nbcon.c
>> @@ -1453,24 +1453,31 @@ enum nbcon_prio nbcon_get_default_prio(void)
>> return NBCON_PRIO_NORMAL;
>> }
>>
>> -/*
>> - * Track if it is allowed to perform unsafe hostile takeovers of console
>> - * ownership. When true, console drivers might perform unsafe actions while
>> - * printing. It is externally available via nbcon_allow_unsafe_takeover().
>> - */
>> -static bool panic_nbcon_allow_unsafe_takeover;
>> -
>> /**
>> * nbcon_allow_unsafe_takeover - Check if unsafe console takeovers are allowed
>> + * for a specified console and reason
>> *
>> - * Return: True, when it is permitted to perform unsafe console printing
>> + * @con: The console to check
>> + * @reason: The reason for the unsafe takeover
>> *
>> - * This is also used by console_is_usable() to determine if it is allowed to
>> - * call write_atomic() callbacks flagged as unsafe (CON_NBCON_ATOMIC_UNSAFE).
>> + * Return: True, when @con is allowed to perform unsafe console printing
>> */
>> -static bool nbcon_allow_unsafe_takeover(void)
>> +static bool nbcon_allow_unsafe_takeover(struct console *con, enum pr_flush_reason reason)
>
> Nit: It seems that the @con parameter is not used in this version.
> So, it might trigger a warning during bisection.

It was a lazy attempt to reduce code churn within the series. I will add
@con in the patch that actually needs it.

John