snmp: add align parameter to snmp_mib_init()

In preparation for 64bit snmp counters for some mibs,
add an 'align' parameter to snmp_mib_init(), instead
of assuming mibs only contain 'unsigned long' fields.

Callers can use __alignof__(type) to provide correct
alignment.

Signed-off-by: Eric Dumazet <[email protected]>
CC: Herbert Xu <[email protected]>
CC: Arnaldo Carvalho de Melo <[email protected]>
CC: Hideaki YOSHIFUJI <[email protected]>
CC: Vlad Yasevich <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Eric Dumazet 2010-06-22 20:58:41 +00:00 • committed by David S. Miller
commit 1823e4c80e
7 changed files with 40 additions and 22 deletions

View file

@ -1002,7 +1002,8 @@ EXPORT_SYMBOL_GPL(dccp_shutdown);
static inline int dccp_mib_init(void)
{
return snmp_mib_init((void __percpu **)dccp_statistics,
sizeof(struct dccp_mib));
sizeof(struct dccp_mib),
__alignof__(struct dccp_mib));
}
static inline void dccp_mib_exit(void)