Re: [PATCH] printk: deduplicate print_prefix() calls

2018-11-29 Thread Petr Mladek
On Sat 2018-11-24 23:28:36, Tetsuo Handa wrote: > Since /sys/module/printk/parameters/time can change from N to Y between > "msg_print_text() called print_prefix() with buf == NULL" and > "msg_print_text() again calls print_prefix() with buf != NULL", it is not > safe for print_time() to unconditio

Re: [PATCH] printk: deduplicate print_prefix() calls

2018-11-26 Thread Tetsuo Handa
On 2018/11/26 16:56, Sergey Senozhatsky wrote: > Or we can "copy" the value of printk_time and use it in print_prefix(), > and we will pick up an updated value next time we do msg_print_text()? Yes, that is also possible. But it would be better to pass as a function argument to print_prefix() rath

Re: [PATCH] printk: deduplicate print_prefix() calls

2018-11-25 Thread Sergey Senozhatsky
On (11/24/18 23:28), Tetsuo Handa wrote: > Since /sys/module/printk/parameters/time can change from N to Y between > "msg_print_text() called print_prefix() with buf == NULL" and > "msg_print_text() again calls print_prefix() with buf != NULL", it is not > safe for print_time() to unconditionally r

[PATCH] printk: deduplicate print_prefix() calls

2018-11-24 Thread Tetsuo Handa
Since /sys/module/printk/parameters/time can change from N to Y between "msg_print_text() called print_prefix() with buf == NULL" and "msg_print_text() again calls print_prefix() with buf != NULL", it is not safe for print_time() to unconditionally return 0 if printk_time == false. But print_prefi