Re: [RFC][PATCH 1/2] kthread: Add is_user_thread() and is_kernel_thread() helper functions
From: Steven Rostedt
Date: Sat Apr 26 2025 - 08:37:58 EST
On Sat, 26 Apr 2025 14:08:46 +0300
Borislav Petkov <bp@xxxxxxxxx> 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