Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1479684
| From | Jia He <hejianet@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC PATCH v3 6/7] ipv6: Remove useless parameter in __snmp6_fill_statsdev |
| Date | 2016-09-09 08:40 +0200 |
| Message-ID | <sfnDH-7Sc-13@gated-at.bofh.it> (permalink) |
| References | <sfnDH-7Sc-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The parameter items(always ICMP6_MIB_MAX) is useless for __snmp6_fill_statsdev.
Signed-off-by: Jia He <hejianet@gmail.com>
---
net/ipv6/addrconf.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index f418d2e..e170554 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4952,18 +4952,18 @@ static inline size_t inet6_if_nlmsg_size(void)
}
static inline void __snmp6_fill_statsdev(u64 *stats, atomic_long_t *mib,
- int items, int bytes)
+ int bytes)
{
int i;
- int pad = bytes - sizeof(u64) * items;
+ int pad = bytes - sizeof(u64) * ICMP6_MIB_MAX;
BUG_ON(pad < 0);
/* Use put_unaligned() because stats may not be aligned for u64. */
- put_unaligned(items, &stats[0]);
- for (i = 1; i < items; i++)
+ put_unaligned(ICMP6_MIB_MAX, &stats[0]);
+ for (i = 1; i < ICMP6_MIB_MAX; i++)
put_unaligned(atomic_long_read(&mib[i]), &stats[i]);
- memset(&stats[items], 0, pad);
+ memset(&stats[ICMP6_MIB_MAX], 0, pad);
}
static inline void __snmp6_fill_stats64(u64 *stats, void __percpu *mib,
@@ -4996,7 +4996,7 @@ static void snmp6_fill_stats(u64 *stats, struct inet6_dev *idev, int attrtype,
offsetof(struct ipstats_mib, syncp));
break;
case IFLA_INET6_ICMP6STATS:
- __snmp6_fill_statsdev(stats, idev->stats.icmpv6dev->mibs, ICMP6_MIB_MAX, bytes);
+ __snmp6_fill_statsdev(stats, idev->stats.icmpv6dev->mibs, bytes);
break;
}
}
--
1.8.3.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH v3 0/7] Reduce cache miss for snmp_fold_field Jia He <hejianet@gmail.com> - 2016-09-09 08:40 +0200
[RFC PATCH v3 4/7] proc: Reduce cache miss in sctp_snmp_seq_show Jia He <hejianet@gmail.com> - 2016-09-09 08:40 +0200
[RFC PATCH v3 2/7] proc: Reduce cache miss in {snmp,netstat}_seq_show Jia He <hejianet@gmail.com> - 2016-09-09 08:40 +0200
Re: [RFC PATCH v3 2/7] proc: Reduce cache miss in {snmp,netstat}_seq_show Marcelo <marcelo.leitner@gmail.com> - 2016-09-12 21:00 +0200
Re: [RFC PATCH v3 2/7] proc: Reduce cache miss in {snmp,netstat}_seq_show hejianet <hejianet@gmail.com> - 2016-09-14 05:20 +0200
Re: [RFC PATCH v3 2/7] proc: Reduce cache miss in {snmp,netstat}_seq_show hejianet <hejianet@gmail.com> - 2016-09-14 08:00 +0200
Re: [RFC PATCH v3 2/7] proc: Reduce cache miss in {snmp,netstat}_seq_show Marcelo <marcelo.leitner@gmail.com> - 2016-09-14 14:00 +0200
Re: [RFC PATCH v3 2/7] proc: Reduce cache miss in {snmp,netstat}_seq_show hejianet <hejianet@gmail.com> - 2016-09-21 19:10 +0200
Re: [RFC PATCH v3 2/7] proc: Reduce cache miss in {snmp,netstat}_seq_show Marcelo <marcelo.leitner@gmail.com> - 2016-09-21 20:30 +0200
Re: [RFC PATCH v3 2/7] proc: Reduce cache miss in {snmp,netstat}_seq_show hejianet <hejianet@gmail.com> - 2016-09-22 07:40 +0200
[RFC PATCH v3 6/7] ipv6: Remove useless parameter in __snmp6_fill_statsdev Jia He <hejianet@gmail.com> - 2016-09-09 08:40 +0200
[RFC PATCH v3 5/7] proc: Reduce cache miss in xfrm_statistics_seq_show Jia He <hejianet@gmail.com> - 2016-09-09 08:40 +0200
[RFC PATCH v3 1/7] net:snmp: Introduce generic batch interfaces for snmp_get_cpu_field{,64} Jia He <hejianet@gmail.com> - 2016-09-09 08:40 +0200
[RFC PATCH v3 3/7] proc: Reduce cache miss in snmp6_seq_show Jia He <hejianet@gmail.com> - 2016-09-09 08:40 +0200
Re: [RFC PATCH v3 3/7] proc: Reduce cache miss in snmp6_seq_show Marcelo <marcelo.leitner@gmail.com> - 2016-09-12 21:10 +0200
Re: [RFC PATCH v3 3/7] proc: Reduce cache miss in snmp6_seq_show hejianet <hejianet@gmail.com> - 2016-09-14 05:20 +0200
[RFC PATCH v3 7/7] net: Suppress the "Comparison to NULL could be written" warning Jia He <hejianet@gmail.com> - 2016-09-09 08:40 +0200
csiph-web