Re: [PATCH] apm-emulation: Make use of the helper macro kthread_run()

From: gregkh@xxxxxxxxxxxxxxxxxxx
Date: Thu Oct 10 2024 - 05:30:56 EST


On Thu, Oct 10, 2024 at 09:23:46AM +0000, 胡连勤 wrote:
> From: Lianqin Hu <hulianqin@xxxxxxxx>
>
> Repalce kthread_create/wake_up_process() with kthread_run()
> to simplify the code.
>
> Signed-off-by: Lianqin Hu <hulianqin@xxxxxxxx>
> ---
> drivers/char/apm-emulation.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
> index e795390b070f..3c183370a5d6 100644
> --- a/drivers/char/apm-emulation.c
> +++ b/drivers/char/apm-emulation.c
> @@ -636,13 +636,12 @@ static int __init apm_init(void)
> return -ENODEV;
> }
>
> - kapmd_tsk = kthread_create(kapmd, NULL, "kapmd");
> + kapmd_tsk = kthread_run(kapmd, NULL, "kapmd");
> if (IS_ERR(kapmd_tsk)) {
> ret = PTR_ERR(kapmd_tsk);
> kapmd_tsk = NULL;
> goto out;
> }
> - wake_up_process(kapmd_tsk);

Do you have this hardware? If not, I would not recommend making changes
like this without being able to test it.

thanks,

greg k-h