diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-04-10 03:48:43 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-10 03:48:43 -0700 |
commit | 24e8b7e48471514c9311c733b3f399bd20d014fe (patch) | |
tree | 6563b3ac632b01d71909313c6feb0ff704862d4f | |
parent | 387a5487f5a1f8bfc3b2c5818e50dfd19eeb4f3f (diff) |
[DCCP]: Use snmp_mib_{init,free}().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/dccp/proto.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index e3f5d37b84b..d534cdf9603 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c @@ -1010,33 +1010,14 @@ void dccp_shutdown(struct sock *sk, int how) EXPORT_SYMBOL_GPL(dccp_shutdown); -static int __init dccp_mib_init(void) +static inline int dccp_mib_init(void) { - int rc = -ENOMEM; - - dccp_statistics[0] = alloc_percpu(struct dccp_mib); - if (dccp_statistics[0] == NULL) - goto out; - - dccp_statistics[1] = alloc_percpu(struct dccp_mib); - if (dccp_statistics[1] == NULL) - goto out_free_one; - - rc = 0; -out: - return rc; -out_free_one: - free_percpu(dccp_statistics[0]); - dccp_statistics[0] = NULL; - goto out; - + return snmp_mib_init((void**)dccp_statistics, sizeof(struct dccp_mib)); } -static void dccp_mib_exit(void) +static inline void dccp_mib_exit(void) { - free_percpu(dccp_statistics[0]); - free_percpu(dccp_statistics[1]); - dccp_statistics[0] = dccp_statistics[1] = NULL; + snmp_mib_free((void**)dccp_statistics); } static int thash_entries; |