diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2006-01-08 04:00:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:12:39 -0500 |
commit | f9f7500521b25dbf1aba476b81230489ad8e2c4b (patch) | |
tree | f2bf2f64023c4968ac8d08da54b8aaef86354591 | |
parent | b792de39d892e06b18ddea85be076bae123d6bf6 (diff) |
[PATCH] slab: remove unused align parameter from alloc_percpu
__alloc_percpu and alloc_percpu both take an 'align' argument which is
completely ignored. snmp6_mib_init() in net/ipv6/af_inet6.c attempts to use
it, but it will be ignored. Therefore, remove the 'align' argument and fixup
the lone caller.
Signed-off-by: Matthew Dobson <colpatch@us.ibm.com>
Acked-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/percpu.h | 7 | ||||
-rw-r--r-- | mm/slab.c | 3 | ||||
-rw-r--r-- | net/ipv6/af_inet6.c | 4 |
3 files changed, 6 insertions, 8 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index fb8d2d24e4bb..20317d88deba 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -33,14 +33,14 @@ struct percpu_data { | |||
33 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ | 33 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ |
34 | }) | 34 | }) |
35 | 35 | ||
36 | extern void *__alloc_percpu(size_t size, size_t align); | 36 | extern void *__alloc_percpu(size_t size); |
37 | extern void free_percpu(const void *); | 37 | extern void free_percpu(const void *); |
38 | 38 | ||
39 | #else /* CONFIG_SMP */ | 39 | #else /* CONFIG_SMP */ |
40 | 40 | ||
41 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) | 41 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) |
42 | 42 | ||
43 | static inline void *__alloc_percpu(size_t size, size_t align) | 43 | static inline void *__alloc_percpu(size_t size) |
44 | { | 44 | { |
45 | void *ret = kmalloc(size, GFP_KERNEL); | 45 | void *ret = kmalloc(size, GFP_KERNEL); |
46 | if (ret) | 46 | if (ret) |
@@ -55,7 +55,6 @@ static inline void free_percpu(const void *ptr) | |||
55 | #endif /* CONFIG_SMP */ | 55 | #endif /* CONFIG_SMP */ |
56 | 56 | ||
57 | /* Simple wrapper for the common case: zeros memory. */ | 57 | /* Simple wrapper for the common case: zeros memory. */ |
58 | #define alloc_percpu(type) \ | 58 | #define alloc_percpu(type) ((type *)(__alloc_percpu(sizeof(type)))) |
59 | ((type *)(__alloc_percpu(sizeof(type), __alignof__(type)))) | ||
60 | 59 | ||
61 | #endif /* __LINUX_PERCPU_H */ | 60 | #endif /* __LINUX_PERCPU_H */ |
@@ -2944,9 +2944,8 @@ EXPORT_SYMBOL(__kmalloc); | |||
2944 | * Objects should be dereferenced using the per_cpu_ptr macro only. | 2944 | * Objects should be dereferenced using the per_cpu_ptr macro only. |
2945 | * | 2945 | * |
2946 | * @size: how many bytes of memory are required. | 2946 | * @size: how many bytes of memory are required. |
2947 | * @align: the alignment, which can't be greater than SMP_CACHE_BYTES. | ||
2948 | */ | 2947 | */ |
2949 | void *__alloc_percpu(size_t size, size_t align) | 2948 | void *__alloc_percpu(size_t size) |
2950 | { | 2949 | { |
2951 | int i; | 2950 | int i; |
2952 | struct percpu_data *pdata = kmalloc(sizeof (*pdata), GFP_KERNEL); | 2951 | struct percpu_data *pdata = kmalloc(sizeof (*pdata), GFP_KERNEL); |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 68afc53be662..25c3fe5005d9 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -689,11 +689,11 @@ snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign) | |||
689 | if (ptr == NULL) | 689 | if (ptr == NULL) |
690 | return -EINVAL; | 690 | return -EINVAL; |
691 | 691 | ||
692 | ptr[0] = __alloc_percpu(mibsize, mibalign); | 692 | ptr[0] = __alloc_percpu(mibsize); |
693 | if (!ptr[0]) | 693 | if (!ptr[0]) |
694 | goto err0; | 694 | goto err0; |
695 | 695 | ||
696 | ptr[1] = __alloc_percpu(mibsize, mibalign); | 696 | ptr[1] = __alloc_percpu(mibsize); |
697 | if (!ptr[1]) | 697 | if (!ptr[1]) |
698 | goto err1; | 698 | goto err1; |
699 | 699 | ||