lkml.org 
[lkml]   [2018]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 03/12] cgroup: use for_each_if
    Date
    Avoids the need to invert the condition instead of the open-coded
    version.

    Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Li Zefan <lizefan@huawei.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: cgroups@vger.kernel.org
    ---
    include/linux/cgroup.h | 4 +---
    1 file changed, 1 insertion(+), 3 deletions(-)

    diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
    index c9fdf6f57913..666c6200d61d 100644
    --- a/include/linux/cgroup.h
    +++ b/include/linux/cgroup.h
    @@ -287,9 +287,7 @@ void css_task_iter_end(struct css_task_iter *it);
    for ((leader) = cgroup_taskset_first((tset), &(dst_css)); \
    (leader); \
    (leader) = cgroup_taskset_next((tset), &(dst_css))) \
    - if ((leader) != (leader)->group_leader) \
    - ; \
    - else
    + for_each_if ((leader) == (leader)->group_leader)

    /*
    * Inline functions.
    --
    2.18.0
    \
     
     \ /
      Last update: 2018-07-09 10:37    [W:2.844 / U:2.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site