cgroup: Avoid unnecessary looping in cgroup_no_v1()
authorXiu Jianfeng <xiujianfeng@huawei.com>
Fri, 19 Apr 2024 08:53:16 +0000 (08:53 +0000)
committerTejun Heo <tj@kernel.org>
Fri, 19 Apr 2024 15:43:36 +0000 (05:43 -1000)
No need to continue the for_each_subsys loop after the token matches the
name of subsys and cgroup_no_v1_mask is set.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup-v1.c

index 520a11cb12f44cca94d3b4edd6f4caa2f8f3d805..b9dbf6bf2779d684d29122dbebd40fc40d67e3a1 100644 (file)
@@ -1335,6 +1335,7 @@ static int __init cgroup_no_v1(char *str)
                                continue;
 
                        cgroup_no_v1_mask |= 1 << i;
+                       break;
                }
        }
        return 1;