summaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-12-29 18:20:06 -0800
committerDavid S. Miller <davem@davemloft.net>2008-12-29 18:20:06 -0800
commit91b208c7c1db4cefa2247f8243fbda75b0472d24 (patch)
tree8acdb0d44f2223f36ee20f7975487fd1cdcaa582 /net/xfrm
parent2d0658d4ef92e4958172c832bd88c961840e599e (diff)
downloadlinux-stable-91b208c7c1db4cefa2247f8243fbda75b0472d24.tar.gz
linux-stable-91b208c7c1db4cefa2247f8243fbda75b0472d24.tar.bz2
linux-stable-91b208c7c1db4cefa2247f8243fbda75b0472d24.zip
net: make xfrm_statistics_seq_show use generic snmp_fold_field
No reason to roll our own here. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_proc.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/net/xfrm/xfrm_proc.c b/net/xfrm/xfrm_proc.c
index 284eaef1dbf2..a2adb51849a9 100644
--- a/net/xfrm/xfrm_proc.c
+++ b/net/xfrm/xfrm_proc.c
@@ -44,27 +44,14 @@ static struct snmp_mib xfrm_mib_list[] = {
SNMP_MIB_SENTINEL
};
-static unsigned long
-fold_field(void *mib[], int offt)
-{
- unsigned long res = 0;
- int i;
-
- for_each_possible_cpu(i) {
- res += *(((unsigned long *)per_cpu_ptr(mib[0], i)) + offt);
- res += *(((unsigned long *)per_cpu_ptr(mib[1], i)) + offt);
- }
- return res;
-}
-
static int xfrm_statistics_seq_show(struct seq_file *seq, void *v)
{
struct net *net = seq->private;
int i;
for (i=0; xfrm_mib_list[i].name; i++)
seq_printf(seq, "%-24s\t%lu\n", xfrm_mib_list[i].name,
- fold_field((void **)net->mib.xfrm_statistics,
- xfrm_mib_list[i].entry));
+ snmp_fold_field((void **)net->mib.xfrm_statistics,
+ xfrm_mib_list[i].entry));
return 0;
}