PATCH] cpumask 11/10 comment, spacing tweaks

From: Paul Jackson
Date: Tue Jun 08 2004 - 19:15:54 EST


Andrew - If you take my other cpumask patchs, could you add this one?
I just noticed that my 'big cpumask comment' was a bit stale.

No code changes - just spacing and comments.

Tweak cpumask.h comments, spacing:

1) Add comments for cpu_present_map macros: num_present_cpus() and cpu_present()
2) Remove comments for obsolete macros: cpu_set_online(), cpu_set_offline()
3) Reorder a few comment lines, to match the code and confuse readers of this patch
3) Tabify one chunk of code

include/linux/cpumask.h | 34 +++++++++++++++++++---------------
1 files changed, 19 insertions(+), 15 deletions(-)

Signed-off-by: Paul Jackson <pj@xxxxxxx>

Index: 2.6.7-rc2-mm2/include/linux/cpumask.h
===================================================================
--- 2.6.7-rc2-mm2.orig/include/linux/cpumask.h 2004-06-07 15:45:25.000000000 -0700
+++ 2.6.7-rc2-mm2/include/linux/cpumask.h 2004-06-08 16:46:05.000000000 -0700
@@ -47,17 +47,21 @@
* int cpumask_scnprintf(buf, len, mask) Format cpumask for printing
* int cpumask_parse(ubuf, ulen, mask) Parse ascii string as cpumask
*
+ * for_each_cpu_mask(cpu, mask) for-loop cpu over mask
+ *
* int num_online_cpus() Number of online CPUs
* int num_possible_cpus() Number of all possible CPUs
+ * int num_present_cpus() Number of present CPUs
+ *
* int cpu_online(cpu) Is some cpu online?
* int cpu_possible(cpu) Is some cpu possible?
- * void cpu_set_online(cpu) set cpu in cpu_online_map
- * void cpu_set_offline(cpu) clear cpu in cpu_online_map
+ * int cpu_present(cpu) Is some cpu present (can schedule)?
+ *
* int any_online_cpu(mask) First online cpu in mask
*
- * for_each_cpu_mask(cpu, mask) for-loop cpu over mask
* for_each_cpu(cpu) for-loop cpu over cpu_possible_map
* for_each_online_cpu(cpu) for-loop cpu over cpu_online_map
+ * for_each_present_cpu(cpu) for-loop cpu over cpu_present_map
*
* Subtlety:
* 1) The 'type-checked' form of cpu_isset() causes gcc (3.3.2, anyway)
@@ -336,19 +340,19 @@
extern cpumask_t cpu_present_map;

#if NR_CPUS > 1
-#define num_online_cpus() cpus_weight(cpu_online_map)
-#define num_possible_cpus() cpus_weight(cpu_possible_map)
-#define num_present_cpus() cpus_weight(cpu_present_map)
-#define cpu_online(cpu) cpu_isset((cpu), cpu_online_map)
-#define cpu_possible(cpu) cpu_isset((cpu), cpu_possible_map)
-#define cpu_present(cpu) cpu_isset((cpu), cpu_present_map)
+#define num_online_cpus() cpus_weight(cpu_online_map)
+#define num_possible_cpus() cpus_weight(cpu_possible_map)
+#define num_present_cpus() cpus_weight(cpu_present_map)
+#define cpu_online(cpu) cpu_isset((cpu), cpu_online_map)
+#define cpu_possible(cpu) cpu_isset((cpu), cpu_possible_map)
+#define cpu_present(cpu) cpu_isset((cpu), cpu_present_map)
#else
-#define num_online_cpus() 1
-#define num_possible_cpus() 1
-#define num_present_cpus() 1
-#define cpu_online(cpu) ((cpu) == 0)
-#define cpu_possible(cpu) ((cpu) == 0)
-#define cpu_present(cpu) ((cpu) == 0)
+#define num_online_cpus() 1
+#define num_possible_cpus() 1
+#define num_present_cpus() 1
+#define cpu_online(cpu) ((cpu) == 0)
+#define cpu_possible(cpu) ((cpu) == 0)
+#define cpu_present(cpu) ((cpu) == 0)
#endif

#define any_online_cpu(mask) \


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