diff options
author | Andrew Morton <akpm@osdl.org> | 2006-03-25 06:08:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 11:22:59 -0500 |
commit | ccb46000f4bb459777686611157ac0eac928704e (patch) | |
tree | 461e956d9e27a7afa7de64950f3186070ffa61f5 | |
parent | 64b91379439ff0fb007bde90eb496299c14a9b2a (diff) |
[PATCH] cpumask: uninline first_cpu()
text data bss dec hex filename
before: 3490577 1322408 360000 5172985 4eeef9 vmlinux
after: 3488027 1322496 360128 5170651 4ee5db vmlinux
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/cpumask.h | 11 | ||||
-rw-r--r-- | lib/Makefile | 2 | ||||
-rw-r--r-- | lib/cpumask.c | 11 |
3 files changed, 19 insertions, 5 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 60e56c6e03dd..9b702fd24a72 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -212,11 +212,12 @@ static inline void __cpus_shift_left(cpumask_t *dstp, | |||
212 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | 212 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); |
213 | } | 213 | } |
214 | 214 | ||
215 | #define first_cpu(src) __first_cpu(&(src), NR_CPUS) | 215 | #ifdef CONFIG_SMP |
216 | static inline int __first_cpu(const cpumask_t *srcp, int nbits) | 216 | int __first_cpu(const cpumask_t *srcp); |
217 | { | 217 | #define first_cpu(src) __first_cpu(&(src)) |
218 | return min_t(int, nbits, find_first_bit(srcp->bits, nbits)); | 218 | #else |
219 | } | 219 | #define first_cpu(src) 0 |
220 | #endif | ||
220 | 221 | ||
221 | #define next_cpu(n, src) __next_cpu((n), &(src), NR_CPUS) | 222 | #define next_cpu(n, src) __next_cpu((n), &(src), NR_CPUS) |
222 | static inline int __next_cpu(int n, const cpumask_t *srcp, int nbits) | 223 | static inline int __next_cpu(int n, const cpumask_t *srcp, int nbits) |
diff --git a/lib/Makefile b/lib/Makefile index 648b2c1242fd..f827e3c24ec0 100644 --- a/lib/Makefile +++ b/lib/Makefile | |||
@@ -7,6 +7,8 @@ lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \ | |||
7 | idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \ | 7 | idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \ |
8 | sha1.o | 8 | sha1.o |
9 | 9 | ||
10 | lib-$(CONFIG_SMP) += cpumask.o | ||
11 | |||
10 | lib-y += kobject.o kref.o kobject_uevent.o klist.o | 12 | lib-y += kobject.o kref.o kobject_uevent.o klist.o |
11 | 13 | ||
12 | obj-y += sort.o parser.o halfmd4.o iomap_copy.o | 14 | obj-y += sort.o parser.o halfmd4.o iomap_copy.o |
diff --git a/lib/cpumask.c b/lib/cpumask.c new file mode 100644 index 000000000000..1560d97390dd --- /dev/null +++ b/lib/cpumask.c | |||
@@ -0,0 +1,11 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/bitops.h> | ||
3 | #include <linux/cpumask.h> | ||
4 | #include <linux/module.h> | ||
5 | |||
6 | int __first_cpu(const cpumask_t *srcp) | ||
7 | { | ||
8 | return min_t(int, NR_CPUS, find_first_bit(srcp->bits, NR_CPUS)); | ||
9 | } | ||
10 | EXPORT_SYMBOL(__first_cpu); | ||
11 | |||