* [PATCH net-2.6.26] [DCCP]: Use snmp_mib_{init,free}().
@ 2008-04-03 15:16 YOSHIFUJI Hideaki / 吉藤英明
2008-04-03 15:36 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-04-03 15:16 UTC (permalink / raw)
To: davem; +Cc: netdev, yoshfuji
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index e3f5d37..d534cdf 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;
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-10 10:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-03 15:16 [PATCH net-2.6.26] [DCCP]: Use snmp_mib_{init,free}() YOSHIFUJI Hideaki / 吉藤英明
2008-04-03 15:36 ` Arnaldo Carvalho de Melo
2008-04-10 10:48 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).