Skip to content

Commit

Permalink
[PATCH] cpuset: minor code refinements
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Dec 7, 2006
1 parent 5ec68b2 commit 6960406
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6960406

Please sign in to comment.