Skip to content

Commit 1d416a1

Browse files
author
Christian Brauner
committed
pid: use pid_has_task() in __change_pid()
Replace hlist_empty() with the new pid_has_task() helper which is more idiomatic, easier to grep for, and unifies how callers perform this check. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Link: https://lore.kernel.org/r/20191017101832.5985-3-christian.brauner@ubuntu.com
1 parent 67fc700 commit 1d416a1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/pid.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ static void __change_pid(struct task_struct *task, enum pid_type type,
299299
*pid_ptr = new;
300300

301301
for (tmp = PIDTYPE_MAX; --tmp >= 0; )
302-
if (!hlist_empty(&pid->tasks[tmp]))
302+
if (pid_has_task(pid, tmp))
303303
return;
304304

305305
free_pid(pid);

0 commit comments

Comments
 (0)