Re: [RFC 1/2] printk: Add kernel parameter: mute_console

From: Guenter Roeck
Date: Thu Oct 22 2020 - 10:22:17 EST


On 10/22/20 6:45 AM, Steven Rostedt wrote:
> On Thu, 22 Oct 2020 13:42:27 +0200
> Petr Mladek <pmladek@xxxxxxxx> wrote:
>
>> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
>> index fe64a49344bf..63fb96630767 100644
>> --- a/kernel/printk/printk.c
>> +++ b/kernel/printk/printk.c
>> @@ -1207,6 +1207,19 @@ void __init setup_log_buf(int early)
>> memblock_free(__pa(new_log_buf), new_log_buf_len);
>> }
>>
>> +static bool mute_console;
>> +
>> +static int __init mute_console_setup(char *str)
>> +{
>> + mute_console = true;
>> + pr_info("All consoles muted.\n");
>> +
>> + return 0;
>> +}
>> +
>> +early_param("mute_console", mute_console_setup);
>> +module_param(mute_console, bool, 0644);
>> +
>
> Why have both early_param and module_param? What's the purpose of
> module_param? Usually that's there to just set a variable, without a need
> for another interface. But if you have early_param() that sets
> mute_console, isn't that redundant?
>

For me the question was why we would need an extra module parameter
in the first place instead of just making "console=" and "console=null"
official. It doesn't really matter for us as long as "console=" is still
supported, I just don't see the point.

Thanks,
Guenter