[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211127145919.31159-1-richard.weiyang@gmail.com>
Date: Sat, 27 Nov 2021 14:59:18 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: tj@...nel.org, lizefan.x@...edance.com, hannes@...xchg.org
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
Wei Yang <richard.weiyang@...il.com>
Subject: [PATCH 1/2] cgroup: cgroup_subsys[ssid] is never NULL
When the check, (ssid) < CGROUP_SUBSYS_COUNT, passed, it means
cgroup_subsys[ssid] is defined to its proper value. It is not
necessary to use a true to enter the loop.
Signed-off-by: Wei Yang <richard.weiyang@...il.com>
---
kernel/cgroup/cgroup-internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h
index bfbeabc17a9d..0c5d1df6cdef 100644
--- a/kernel/cgroup/cgroup-internal.h
+++ b/kernel/cgroup/cgroup-internal.h
@@ -163,7 +163,7 @@ extern struct file_system_type cgroup_fs_type;
*/
#define for_each_subsys(ss, ssid) \
for ((ssid) = 0; (ssid) < CGROUP_SUBSYS_COUNT && \
- (((ss) = cgroup_subsys[ssid]) || true); (ssid)++)
+ ((ss) = cgroup_subsys[ssid]); (ssid)++)
static inline bool cgroup_is_dead(const struct cgroup *cgrp)
{
--
2.33.1
Powered by blists - more mailing lists