[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220422180734.225718b7@gandalf.local.home>
Date: Fri, 22 Apr 2022 18:07:34 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Mark-PK Tsai <mark-pk.tsai@...iatek.com>
Cc: <mingo@...hat.com>, <matthias.bgg@...il.com>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>, <yj.chiang@...iatek.com>
Subject: Re: [PATCH v3 2/2] tracing: make tracer_init_tracefs initcall
asynchronous
On Wed, 23 Mar 2022 23:22:57 +0800
Mark-PK Tsai <mark-pk.tsai@...iatek.com> wrote:
> +static __init int tracer_init_tracefs(void)
> +{
> + int ret;
> +
> + trace_access_lock_init();
> +
> + ret = tracing_init_dentry();
> + if (ret)
> + return 0;
> +
> + INIT_WORK(&tracerfs_init_work, tracer_init_tracefs_work_func);
> + if (!eval_map_wq)
> + tracer_init_tracefs_work_func(&tracerfs_init_work);
Why go through the bother of doing the INIT_WORK if eval_map_wq is not
created? Just do:
if (eval_map_wq) {
INIT_WORK(&tracerfs_init_work, tracer_init_tracefs_work_func);
queue_work(eval_map_wq, &tracerfs_init_work);
} else {
tracer_init_tracefs_work_func(NULL);
}
But that's just a nit anyway.
-- Steve
> + else
> + queue_work(eval_map_wq, &tracerfs_init_work);
>
> return 0;
> }
Powered by blists - more mailing lists