Re: [PATCH] iio: adc: ina2xx: Make use of the helper macro kthread_run()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

Hi,

Thanks for the patch, this looks good!

Reviewed-by: Lars-Peter Clausen <lars@xxxxxxxxxx>

---
[...]
  	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;





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux