mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-26 18:43:33 -05:00
[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>
This commit is contained in:
parent
b792de39d8
commit
f9f7500521
3 changed files with 6 additions and 8 deletions
|
@ -33,14 +33,14 @@ struct percpu_data {
|
||||||
(__typeof__(ptr))__p->ptrs[(cpu)]; \
|
(__typeof__(ptr))__p->ptrs[(cpu)]; \
|
||||||
})
|
})
|
||||||
|
|
||||||
extern void *__alloc_percpu(size_t size, size_t align);
|
extern void *__alloc_percpu(size_t size);
|
||||||
extern void free_percpu(const void *);
|
extern void free_percpu(const void *);
|
||||||
|
|
||||||
#else /* CONFIG_SMP */
|
#else /* CONFIG_SMP */
|
||||||
|
|
||||||
#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
|
#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
|
||||||
|
|
||||||
static inline void *__alloc_percpu(size_t size, size_t align)
|
static inline void *__alloc_percpu(size_t size)
|
||||||
{
|
{
|
||||||
void *ret = kmalloc(size, GFP_KERNEL);
|
void *ret = kmalloc(size, GFP_KERNEL);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -55,7 +55,6 @@ static inline void free_percpu(const void *ptr)
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
/* Simple wrapper for the common case: zeros memory. */
|
/* Simple wrapper for the common case: zeros memory. */
|
||||||
#define alloc_percpu(type) \
|
#define alloc_percpu(type) ((type *)(__alloc_percpu(sizeof(type))))
|
||||||
((type *)(__alloc_percpu(sizeof(type), __alignof__(type))))
|
|
||||||
|
|
||||||
#endif /* __LINUX_PERCPU_H */
|
#endif /* __LINUX_PERCPU_H */
|
||||||
|
|
|
@ -2944,9 +2944,8 @@ EXPORT_SYMBOL(__kmalloc);
|
||||||
* Objects should be dereferenced using the per_cpu_ptr macro only.
|
* Objects should be dereferenced using the per_cpu_ptr macro only.
|
||||||
*
|
*
|
||||||
* @size: how many bytes of memory are required.
|
* @size: how many bytes of memory are required.
|
||||||
* @align: the alignment, which can't be greater than SMP_CACHE_BYTES.
|
|
||||||
*/
|
*/
|
||||||
void *__alloc_percpu(size_t size, size_t align)
|
void *__alloc_percpu(size_t size)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct percpu_data *pdata = kmalloc(sizeof (*pdata), GFP_KERNEL);
|
struct percpu_data *pdata = kmalloc(sizeof (*pdata), GFP_KERNEL);
|
||||||
|
|
|
@ -689,11 +689,11 @@ snmp6_mib_init(void *ptr[2], size_t mibsize, size_t mibalign)
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ptr[0] = __alloc_percpu(mibsize, mibalign);
|
ptr[0] = __alloc_percpu(mibsize);
|
||||||
if (!ptr[0])
|
if (!ptr[0])
|
||||||
goto err0;
|
goto err0;
|
||||||
|
|
||||||
ptr[1] = __alloc_percpu(mibsize, mibalign);
|
ptr[1] = __alloc_percpu(mibsize);
|
||||||
if (!ptr[1])
|
if (!ptr[1])
|
||||||
goto err1;
|
goto err1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue