Skip to contentSkip to conversation

snmp: fix some left over of snmp stats

PATCH Applied Cong Wang 2 participants 2 messages May 12, 2014 – May 14, 2014

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 snmp: fix some left over of snmp stats

Fengguang reported the following sparse warning:

Quoted 1 line
Quoted 1 line

net/ipv6/proc.c:198:41: sparse: incorrect type in argument 1 (different address spaces)

net/ipv6/proc.c:198:41: expected void [noderef] <asn:3>*mib
net/ipv6/proc.c:198:41: got void [noderef] <asn:3>**pcpumib

Fixes commit 698365fa1874aa7635d51667a3 (net: clean up snmp stats code)
Cc David S. Miller <[email protected]>
---
 net/ipv6/proc.c | 8 ++++----
 net/sctp/proc.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
net/ipv6/proc.c +4 -4
index 69cb476..3317440 100644
@@ -186,7 +186,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, atomic_long_t *smib)
 /* can be called either with percpu mib (pcpumib != NULL),
  * or shared one (smib != NULL)
  */
-static void snmp6_seq_show_item(struct seq_file *seq, void __percpu **pcpumib,
+static void snmp6_seq_show_item(struct seq_file *seq, void __percpu *pcpumib,
 				atomic_long_t *smib,
 				const struct snmp_mib *itemlist)
 {
@@ -217,12 +217,12 @@ static int snmp6_seq_show(struct seq_file *seq, void *v)
 
 	snmp6_seq_show_item64(seq, net->mib.ipv6_statistics,
 			    snmp6_ipstats_list, offsetof(struct ipstats_mib, syncp));
-	snmp6_seq_show_item(seq, (void __percpu **)net->mib.icmpv6_statistics,
+	snmp6_seq_show_item(seq, net->mib.icmpv6_statistics,
 			    NULL, snmp6_icmp6_list);
 	snmp6_seq_show_icmpv6msg(seq, net->mib.icmpv6msg_statistics->mibs);
-	snmp6_seq_show_item(seq, (void __percpu **)net->mib.udp_stats_in6,
+	snmp6_seq_show_item(seq, net->mib.udp_stats_in6,
 			    NULL, snmp6_udp6_list);
-	snmp6_seq_show_item(seq, (void __percpu **)net->mib.udplite_stats_in6,
+	snmp6_seq_show_item(seq, net->mib.udplite_stats_in6,
 			    NULL, snmp6_udplite6_list);
 	return 0;
 }
net/sctp/proc.c +1 -1
index 0947f1e..34229ee 100644
@@ -78,7 +78,7 @@ static int sctp_snmp_seq_show(struct seq_file *seq, void *v)
 
 	for (i = 0; sctp_snmp_list[i].name != NULL; i++)
 		seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name,
-			   snmp_fold_field((void __percpu **)net->sctp.sctp_statistics,
+			   snmp_fold_field(net->sctp.sctp_statistics,
 				      sctp_snmp_list[i].entry));
 
 	return 0;
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw

From: Cong Wang <[email protected]>
Date: Mon, 12 May 2014 16:52:02 -0700

Quoted 10 lines

Fengguang reported the following sparse warning:

Quoted 1 line
Quoted 1 line

net/ipv6/proc.c:198:41: sparse: incorrect type in argument 1 (different address spaces)

net/ipv6/proc.c:198:41: expected void [noderef] <asn:3>*mib
net/ipv6/proc.c:198:41: got void [noderef] <asn:3>**pcpumib

Fixes commit 698365fa1874aa7635d51667a3 (net: clean up snmp stats code)
Cc David S. Miller <[email protected]>

Applied.