Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

snmp: fix some left over of snmp stats

Fengguang reported the following sparse warning:

>> 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)
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

WANG Cong and committed by
David S. Miller
c9f2dba6 122ff243

+5 -5
+4 -4
net/ipv6/proc.c
··· 186 186 /* can be called either with percpu mib (pcpumib != NULL), 187 187 * or shared one (smib != NULL) 188 188 */ 189 - static void snmp6_seq_show_item(struct seq_file *seq, void __percpu **pcpumib, 189 + static void snmp6_seq_show_item(struct seq_file *seq, void __percpu *pcpumib, 190 190 atomic_long_t *smib, 191 191 const struct snmp_mib *itemlist) 192 192 { ··· 217 217 218 218 snmp6_seq_show_item64(seq, net->mib.ipv6_statistics, 219 219 snmp6_ipstats_list, offsetof(struct ipstats_mib, syncp)); 220 - snmp6_seq_show_item(seq, (void __percpu **)net->mib.icmpv6_statistics, 220 + snmp6_seq_show_item(seq, net->mib.icmpv6_statistics, 221 221 NULL, snmp6_icmp6_list); 222 222 snmp6_seq_show_icmpv6msg(seq, net->mib.icmpv6msg_statistics->mibs); 223 - snmp6_seq_show_item(seq, (void __percpu **)net->mib.udp_stats_in6, 223 + snmp6_seq_show_item(seq, net->mib.udp_stats_in6, 224 224 NULL, snmp6_udp6_list); 225 - snmp6_seq_show_item(seq, (void __percpu **)net->mib.udplite_stats_in6, 225 + snmp6_seq_show_item(seq, net->mib.udplite_stats_in6, 226 226 NULL, snmp6_udplite6_list); 227 227 return 0; 228 228 }
+1 -1
net/sctp/proc.c
··· 78 78 79 79 for (i = 0; sctp_snmp_list[i].name != NULL; i++) 80 80 seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name, 81 - snmp_fold_field((void __percpu **)net->sctp.sctp_statistics, 81 + snmp_fold_field(net->sctp.sctp_statistics, 82 82 sctp_snmp_list[i].entry)); 83 83 84 84 return 0;