lkml.org 
[lkml]   [2018]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/3] printk: Create helper function to queue deferred console handling
On (06/27/18 16:08), Petr Mladek wrote:
> -int vprintk_deferred(const char *fmt, va_list args)
> +void defer_console(void)
> {
> - int r;
> -
> - r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, 0, fmt, args);
> -
> preempt_disable();
> __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
> irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
> preempt_enable();
> +}
> +
> +int vprintk_deferred(const char *fmt, va_list args)
> +{
> + int r;
> +
> + r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, 0, fmt, args);
> + defer_console();
>
> return r;


You can just call vprintk_emit(LOGLEVEL_SCHED) from vprintk_func(),
then you don't need to factor out vprintk_deferred() and vprintk_emit().
Any reason for that split?

I'd also may be prefer to have a bit different name. I'm talking
about defer_console().

Other than that

Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

-ss

\
 
 \ /
  Last update: 2018-06-28 04:16    [W:0.358 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site