Skip to contentSkip to conversation

net: snmp: fix the wrong ICMP_MIB_MAX value

PATCH In review Shan Wei 2 participants 3 messages Nov 29, 2010 – Dec 1, 2010

Subsystems (2)
lore
Share & tools
lore

Shan Wei

author
#0 lore raw

PATCH 2/3 net: snmp: fix the wrong ICMP_MIB_MAX value

__ICMP_MIB_MAX is equal to the total number of icmp mib, So no need to add 1. This wastes 4/8 bytes memory.

---
 include/net/snmp.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
include/net/snmp.h +1 -2
index 835c587..762e2ab 100644
@@ -60,8 +60,7 @@ struct ipstats_mib {
 };
 
 /* ICMP */
-#define ICMP_MIB_MAX	(__ICMP_MIB_MAX + 1)
-
+#define ICMP_MIB_MAX	__ICMP_MIB_MAX
 struct icmp_mib {
 	unsigned long	mibs[ICMP_MIB_MAX];
 };
Signature · 1 line
1.6.3.3
maintainer
#1 lore raw

From: Shan Wei <[email protected]>
Date: Mon, 29 Nov 2010 14:53:55 +0800

include/net/snmp.h struct ipstats_mib { · line 64

Quoted 8 lines
include/net/snmp.h +1 -2
@@ -60,8 +60,7 @@ struct ipstats_mib {
 };
 
 /* ICMP */
-#define ICMP_MIB_MAX	(__ICMP_MIB_MAX + 1)
-
+#define ICMP_MIB_MAX	__ICMP_MIB_MAX
 struct icmp_mib {

In all of my trees there is an "ICMP_MIB_DUMMY" define here, and it's been there forever, I have no idea what you are patching against.

maintainer
#2 lore raw

From: David Miller <[email protected]>
Date: Wed, 01 Dec 2010 12:35:50 -0800 (PST)

Quoted 6 lines

From: Shan Wei <[email protected]>
Date: Mon, 29 Nov 2010 14:53:55 +0800

Quoted 3 lines
(quoted diff) +0 -0
@@ -60,8 +60,7 @@ struct ipstats_mib {
 };
 
Quoted 8 lines

include/net/snmp.h struct ipstats_mib { · line 64

Quoted 5 lines
include/net/snmp.h +1 -2
 /* ICMP */
-#define ICMP_MIB_MAX	(__ICMP_MIB_MAX + 1)
-
+#define ICMP_MIB_MAX	__ICMP_MIB_MAX
 struct icmp_mib {

In all of my trees there is an "ICMP_MIB_DUMMY" define here, and it's been there forever, I have no idea what you are patching against.

Nevermind I see that this depends upon your first patch.

Please resubmit all 3 patches once you've addressed the feedback for patch #1.