Commit 696040670a12f66b17a839011f96d9ca376f688b

Authored by Paul Jackson
Committed by Linus Torvalds
1 parent 5ec68b2e31

[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>

Showing 1 changed file with 4 additions and 5 deletions Side-by-side Diff

... ... @@ -729,9 +729,11 @@
729 729 }
730 730  
731 731 /* Remaining checks don't apply to root cpuset */
732   - if ((par = cur->parent) == NULL)
  732 + if (cur == &top_cpuset)
733 733 return 0;
734 734  
  735 + par = cur->parent;
  736 +
735 737 /* We must be a subset of our parent cpuset */
736 738 if (!is_cpuset_subset(trial, par))
737 739 return -EACCES;
... ... @@ -1060,10 +1062,7 @@
1060 1062 cpu_exclusive_changed =
1061 1063 (is_cpu_exclusive(cs) != is_cpu_exclusive(&trialcs));
1062 1064 mutex_lock(&callback_mutex);
1063   - if (turning_on)
1064   - set_bit(bit, &cs->flags);
1065   - else
1066   - clear_bit(bit, &cs->flags);
  1065 + cs->flags = trialcs.flags;
1067 1066 mutex_unlock(&callback_mutex);
1068 1067  
1069 1068 if (cpu_exclusive_changed)