Skip to contentSkip to conversation

mask ADT: simplify a couple cpumask uses [8/22]

PATCH In review Paul Jackson 1 participant 2 messages Mar 29, 2004 – Apr 1, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mask ADT: simplify a couple cpumask uses [8/22]

Patch_8_of_22 - Simplify a couple of cpumask checks using cpus_subset
Simplify a couple of code fragements using cpus_subset.

diffstat Patch_8_of_22:

 i386/kernel/smp.c   |    5 +----
 x86_64/kernel/smp.c |    4 +---
 2 files changed, 2 insertions(+), 7 deletions(-)

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1713 -> 1.1714
# arch/i386/kernel/smp.c 1.35 -> 1.36
# arch/x86_64/kernel/smp.c 1.19 -> 1.20
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/03/28 [email protected] 1.1714
# Simplify two cpumask calculations using new cpus_subset() operator. # --------------------------------------------
#

arch/i386/kernel/smp.c +1 -4
diff -Nru a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c
@@ -345,7 +345,6 @@
 static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm,
 						unsigned long va)
 {
-	cpumask_t tmp;
 	/*
 	 * A couple of (to be removed) sanity checks:
 	 *
@@ -354,9 +353,7 @@
 	 * - mask must exist :)
 	 */
 	BUG_ON(cpus_empty(cpumask));
-
-	cpus_and(tmp, cpumask, cpu_online_map);
-	BUG_ON(!cpus_equal(cpumask, tmp));
+	BUG_ON(!cpus_subset(cpumask, cpu_online_map));
 	BUG_ON(cpu_isset(smp_processor_id(), cpumask));
 	BUG_ON(!mm);
 
arch/x86_64/kernel/smp.c +1 -3
diff -Nru a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
@@ -234,7 +234,6 @@
 static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm,
 						unsigned long va)
 {
-	cpumask_t tmp;
 	/*
 	 * A couple of (to be removed) sanity checks:
 	 *
@@ -243,8 +242,7 @@
 	 * - mask must exist :)
 	 */
 	BUG_ON(cpus_empty(cpumask));
-	cpus_and(tmp, cpumask, cpu_online_map);
-	BUG_ON(!cpus_equal(tmp, cpumask));
+	BUG_ON(!cpus_subset(cpumask, cpu_online_map));
 	BUG_ON(cpu_isset(smp_processor_id(), cpumask));
 	if (!mm)
 		BUG();
Signature · 3 lines
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373
#1 lore raw

I'm going to drop the cpumask_t refinements in this Patch to the files:

arch/i386/kernel/smp.c
arch/x86_64/kernel/smp.c

A gentleman named "Hari" (Hariprasad Nellitheertha <[email protected]>) on the thread "BUG_ON(!cpus_equal(cpumask, tmp));" is working more essential changes to these same lines. No sense my colliding with him; and if his changes go in, mine are no longer relevant.

So I will clear the path for his work.

Signature · 3 lines
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373