[PATCH] Removes extra checking in kernel/cpuset.c

From: Rakib Mullick
Date: Thu Jul 31 2008 - 11:46:35 EST


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@xxxxxxxxx)

--- 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]));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/