]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
exit: use pid_has_task() in do_wait()
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 17 Oct 2019 10:18:31 +0000 (12:18 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 17 Oct 2019 13:36:58 +0000 (15:36 +0200)
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-4-christian.brauner@ubuntu.com
kernel/exit.c

index a46a50d67002d9877b00c8052ba922e02e9740af..f2d20ab7442276be9663e8c05c2a33c25de88f04 100644 (file)
@@ -1457,7 +1457,7 @@ repeat:
         */
        wo->notask_error = -ECHILD;
        if ((wo->wo_type < PIDTYPE_MAX) &&
-          (!wo->wo_pid || hlist_empty(&wo->wo_pid->tasks[wo->wo_type])))
+          (!wo->wo_pid || !pid_has_task(wo->wo_pid, wo->wo_type)))
                goto notask;
 
        set_current_state(TASK_INTERRUPTIBLE);