[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080404.001614.44373630.yoshfuji@linux-ipv6.org>
Date: Fri, 04 Apr 2008 00:16:14 +0900 (JST)
From: YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@...ux-ipv6.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, yoshfuji@...ux-ipv6.org
Subject: [PATCH net-2.6.26] [SCTP]: Use snmp_mib_{init,free}().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
---
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index ad0a406..225e260 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -972,24 +972,14 @@ int sctp_register_pf(struct sctp_pf *pf, sa_family_t family)
return 1;
}
-static int __init init_sctp_mibs(void)
+static inline int init_sctp_mibs(void)
{
- sctp_statistics[0] = alloc_percpu(struct sctp_mib);
- if (!sctp_statistics[0])
- return -ENOMEM;
- sctp_statistics[1] = alloc_percpu(struct sctp_mib);
- if (!sctp_statistics[1]) {
- free_percpu(sctp_statistics[0]);
- return -ENOMEM;
- }
- return 0;
-
+ return snmp_mib_init((void**)sctp_statistics, sizeof(struct sctp_mib));
}
-static void cleanup_sctp_mibs(void)
+static inline void cleanup_sctp_mibs(void)
{
- free_percpu(sctp_statistics[0]);
- free_percpu(sctp_statistics[1]);
+ snmp_mib_free((void**)sctp_statistics);
}
/* Initialize the universe into something sensible. */
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@...ux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists