Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1477029

[RFC PATCH v2 5/6] ipv6: Remove useless parameter in __snmp6_fill_statsdev

From Jia He <hejianet@gmail.com>
Newsgroups linux.kernel
Subject [RFC PATCH v2 5/6] ipv6: Remove useless parameter in __snmp6_fill_statsdev
Date 2016-09-06 04:40 +0200
Message-ID <seesO-4cL-9@gated-at.bofh.it> (permalink)
References <seesN-4cL-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH v2 0/6] Reduce cache miss for snmp_fold_field Jia He <hejianet@gmail.com> - 2016-09-06 04:40 +0200
  [RFC PATCH v2 4/6] proc: Reduce cache miss in xfrm_statistics_seq_show Jia He <hejianet@gmail.com> - 2016-09-06 04:40 +0200
  [RFC PATCH v2 6/6] net: Suppress the "Comparison to NULL could be written" warning Jia He <hejianet@gmail.com> - 2016-09-06 04:40 +0200
  [RFC PATCH v2 1/6] proc: Reduce cache miss in {snmp,netstat}_seq_show Jia He <hejianet@gmail.com> - 2016-09-06 04:40 +0200
    Re: [RFC PATCH v2 1/6] proc: Reduce cache miss in  {snmp,netstat}_seq_show David Miller <davem@davemloft.net> - 2016-09-07 01:00 +0200
      Re: [RFC PATCH v2 1/6] proc: Reduce cache miss in  {snmp,netstat}_seq_show hejianet <hejianet@gmail.com> - 2016-09-07 04:30 +0200
  [RFC PATCH v2 5/6] ipv6: Remove useless parameter in __snmp6_fill_statsdev Jia He <hejianet@gmail.com> - 2016-09-06 04:40 +0200
  [RFC PATCH v2 2/6] proc: Reduce cache miss in snmp6_seq_show Jia He <hejianet@gmail.com> - 2016-09-06 04:40 +0200
  [RFC PATCH v2 3/6] proc: Reduce cache miss in sctp_snmp_seq_show Jia He <hejianet@gmail.com> - 2016-09-06 04:40 +0200
  Re: [RFC PATCH v2 0/6] Reduce cache miss for snmp_fold_field Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> - 2016-09-06 14:50 +0200
    Re: [RFC PATCH v2 0/6] Reduce cache miss for snmp_fold_field hejianet <hejianet@gmail.com> - 2016-09-07 04:40 +0200

csiph-web