public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] cgroup: cgroup_subsys[ssid] is never NULL
@ 2021-11-27 14:59 Wei Yang
  2021-11-27 14:59 ` [PATCH 2/2] cgroup: get the wrong css for css_alloc() during cgroup_init_subsys() Wei Yang
       [not found] ` <20211127145919.31159-1-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Yang @ 2021-11-27 14:59 UTC (permalink / raw)
  To: tj-DgEjT+Ai2ygdnm+yROfE0A, lizefan.x-EC8Uxl6Npydl57MIdRCFDg,
	hannes-druUgvl0LCNAfugRpC6u6w
  Cc: cgroups-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Wei Yang

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-30  0:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-27 14:59 [PATCH 1/2] cgroup: cgroup_subsys[ssid] is never NULL Wei Yang
2021-11-27 14:59 ` [PATCH 2/2] cgroup: get the wrong css for css_alloc() during cgroup_init_subsys() Wei Yang
     [not found]   ` <20211127145919.31159-2-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2021-11-29 17:39     ` Tejun Heo
     [not found] ` <20211127145919.31159-1-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2021-11-29 17:35   ` [PATCH 1/2] cgroup: cgroup_subsys[ssid] is never NULL Tejun Heo
     [not found]     ` <YaUPej4QUZoFAuOM-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2021-11-30  0:33       ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox