Re: [RFC][PATCH 1/2] kthread: Add is_user_thread() and is_kernel_thread() helper functions

Steven Rostedt
2025-04-26T12:37:48Z

On Sat, 26 Apr 2025 14:08:46 +0300
Borislav Petkov <bp@alien8.de> wrote:

> >+static __always_inline bool is_kernel_thread(struct task_struct *task)
> >+{
> >+ return task->flags & PF_KTHREAD;
>
> return !is_user_thread(task);
>
> or the other way around.

Yeah, I thought about doing that but decided against it.

As Kees mentioned to use !!, I think using the !is_user_thread() is a
better approach.

-- Steve