[PATCH] cpuset: minor code refinements



From: Paul Jackson <pj@xxxxxxx>

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@xxxxxxx>

---
kernel/cpuset.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)

--- 2.6.19-rc1-mm1.orig/kernel/cpuset.c 2006-10-19 01:06:29.000000000 -0700
+++ 2.6.19-rc1-mm1/kernel/cpuset.c 2006-10-19 01:06:49.000000000 -0700
@@ -729,9 +729,11 @@ static int validate_change(const struct
}

/* 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
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)

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.925.600.0401
-
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/



Relevant Pages

  • Re: [PATCH] mm: tidy up follow_hugetlb_page() and get_user_pages()
    ... It also makes sure that len and vma are validated. ... We'd prefer that the functional change not be bundled with a cleanup, ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] mm: tidy up follow_hugetlb_page() and get_user_pages()
    ... It also makes sure that len and vma are validated. ... We'd prefer that the functional change not be bundled with a cleanup, ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [PATCH 03/10] avr32: Move setup_platform() into chip-specific file
    ... functional change since all setup_platformever did was call those ... void setup_platform; ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [PATCH] Cleanup flush_tlb_others fn
    ... Cleanup flush_tlb_others, no functional change. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [PATCH] [22/34] i386: clean up flush_tlb_others fn
    ... Cleanup flush_tlb_others, no functional change. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)