summaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2006-12-06 20:36:15 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:32 -0800
commit696040670a12f66b17a839011f96d9ca376f688b (patch)
treed830a32b354a45423e42a4210a716438750e5755 /kernel/cpuset.c
parent5ec68b2e310437e99c297ba04e1afc5297aa6de1 (diff)
downloadlinux-696040670a12f66b17a839011f96d9ca376f688b.tar.gz
linux-696040670a12f66b17a839011f96d9ca376f688b.tar.bz2
linux-696040670a12f66b17a839011f96d9ca376f688b.zip
[PATCH] cpuset: minor code refinements
A couple of minor code simplifications to the kernel/cpuset.c code. No functional change. Just a little less code and a little more readable. Signed-off-by: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 6313c38c930e..bd1e89c4c96a 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -729,9 +729,11 @@ static int validate_change(const struct cpuset *cur, const struct cpuset *trial)
}
/* Remaining checks don't apply to root cpuset */
- if ((par = cur->parent) == NULL)
+ if (cur == &top_cpuset)
return 0;
+ par = cur->parent;
+
/* We must be a subset of our parent cpuset */
if (!is_cpuset_subset(trial, par))
return -EACCES;
@@ -1060,10 +1062,7 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs, char *buf)
cpu_exclusive_changed =
(is_cpu_exclusive(cs) != is_cpu_exclusive(&trialcs));
mutex_lock(&callback_mutex);
- if (turning_on)
- set_bit(bit, &cs->flags);
- else
- clear_bit(bit, &cs->flags);
+ cs->flags = trialcs.flags;
mutex_unlock(&callback_mutex);
if (cpu_exclusive_changed)