public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Removes extra checking in kernel/cpuset.c
@ 2008-07-31 15:46 Rakib Mullick
  2008-07-31 16:15 ` Paul Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Rakib Mullick @ 2008-07-31 15:46 UTC (permalink / raw)
  To: pj, menage; +Cc: linux-kernel

Hello guys, this patch removes an extra checking over 'cs' in
functions 'guarantee_online_cpus' and 'guarantee_online_mems'.

Thanks.

Signed-off-by: Md.Rakib H. Mullick (rakib.mullick@gmail.com)

--- kernel/cpuset.c.orig	2008-07-31 17:03:34.000000000 +0600
+++ kernel/cpuset.c	2008-07-31 21:33:34.000000000 +0600
@@ -282,10 +282,11 @@ static struct file_system_type cpuset_fs

 static void guarantee_online_cpus(const struct cpuset *cs, cpumask_t *pmask)
 {
-	while (cs && !cpus_intersects(cs->cpus_allowed, cpu_online_map))
-		cs = cs->parent;
-	if (cs)
+	if (cs) {
+		while (!cpus_intersects(cs->cpus_allowed, cpu_online_map))
+			cs = cs->parent;
 		cpus_and(*pmask, cs->cpus_allowed, cpu_online_map);
+	}
 	else
 		*pmask = cpu_online_map;
 	BUG_ON(!cpus_intersects(*pmask, cpu_online_map));
@@ -306,12 +307,13 @@ static void guarantee_online_cpus(const

 static void guarantee_online_mems(const struct cpuset *cs, nodemask_t *pmask)
 {
-	while (cs && !nodes_intersects(cs->mems_allowed,
+	if (cs) {
+		while (!nodes_intersects(cs->mems_allowed,
 					node_states[N_HIGH_MEMORY]))
-		cs = cs->parent;
-	if (cs)
+			cs = cs->parent;
 		nodes_and(*pmask, cs->mems_allowed,
 					node_states[N_HIGH_MEMORY]);
+	}
 	else
 		*pmask = node_states[N_HIGH_MEMORY];
 	BUG_ON(!nodes_intersects(*pmask, node_states[N_HIGH_MEMORY]));

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

end of thread, other threads:[~2008-07-31 19:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <aVIzQ-Oh-23@gated-at.bofh.it>
2008-07-31 18:16 ` [PATCH] Removes extra checking in kernel/cpuset.c James Kosin
2008-07-31 15:46 Rakib Mullick
2008-07-31 16:15 ` Paul Jackson
2008-07-31 17:09   ` Paul Menage
2008-07-31 19:13     ` Paul Jackson

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