Commit 5a17a390 authored by Cong Wang's avatar Cong Wang Committed by David S. Miller

net: make snmp_mib_free static inline

Fengguang reported:

   net/built-in.o: In function `in6_dev_finish_destroy':
   (.text+0x4ca7d): undefined reference to `snmp_mib_free'

this is due to snmp_mib_free() is defined when CONFIG_INET is enabled,
but in6_dev_finish_destroy() is now moved to core kernel.

I think snmp_mib_free() is small enough to be inlined, so just make it
static inline.
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarCong Wang <amwang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 660d98ca
...@@ -194,7 +194,17 @@ static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp ...@@ -194,7 +194,17 @@ static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp
} }
#endif #endif
extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align); extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align);
extern void snmp_mib_free(void __percpu *ptr[2]);
static inline void snmp_mib_free(void __percpu *ptr[SNMP_ARRAY_SZ])
{
int i;
BUG_ON(ptr == NULL);
for (i = 0; i < SNMP_ARRAY_SZ; i++) {
free_percpu(ptr[i]);
ptr[i] = NULL;
}
}
extern struct local_ports { extern struct local_ports {
seqlock_t lock; seqlock_t lock;
......
...@@ -1532,18 +1532,6 @@ int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align) ...@@ -1532,18 +1532,6 @@ int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align)
} }
EXPORT_SYMBOL_GPL(snmp_mib_init); EXPORT_SYMBOL_GPL(snmp_mib_init);
void snmp_mib_free(void __percpu *ptr[SNMP_ARRAY_SZ])
{
int i;
BUG_ON(ptr == NULL);
for (i = 0; i < SNMP_ARRAY_SZ; i++) {
free_percpu(ptr[i]);
ptr[i] = NULL;
}
}
EXPORT_SYMBOL_GPL(snmp_mib_free);
#ifdef CONFIG_IP_MULTICAST #ifdef CONFIG_IP_MULTICAST
static const struct net_protocol igmp_protocol = { static const struct net_protocol igmp_protocol = {
.handler = igmp_rcv, .handler = igmp_rcv,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment