[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6699a823-b7b4-6453-aec0-95058b26c27f@metafoo.de>
Date: Thu, 21 Oct 2021 10:48:32 +0200
From: Lars-Peter Clausen <lars@...afoo.de>
To: Cai Huoqing <caihuoqing@...du.com>
Cc: Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: adc: ina2xx: Make use of the helper macro
kthread_run()
On 10/21/21 10:39 AM, Cai Huoqing wrote:
> Repalce kthread_create/wake_up_process() with kthread_run()
> to simplify the code.
>
> Signed-off-by: Cai Huoqing <caihuoqing@...du.com>
Hi,
Thanks for the patch, this looks good!
Reviewed-by: Lars-Peter Clausen <lars@...afoo.de>
> ---
> [...]
> if (IS_ERR(task))
> return PTR_ERR(task);
>
> get_task_struct(task);
This is unrelated to this patch. But I wonder do we really need the
get_task_struct()? The driver calls put_task_struct() right after
kthread_stop().
kthread_create()/kthread_run() and kthread_stop() already do reference
counting of the task, so we are essentially just double reference
counting. Maybe you can send another patch to cleanup the
get_task_struct()/put_task_struct() in this driver.
> - wake_up_process(task);
> chip->task = task;
>
> return 0;
Powered by blists - more mailing lists