net: constify MIB name tables
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 22 Jan 2010 10:17:26 +0000 (10:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Jan 2010 09:21:27 +0000 (01:21 -0800)
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/snmp.h
net/ipv4/proc.c
net/ipv6/proc.c
net/sctp/proc.c
net/xfrm/xfrm_proc.c

index f0d756f2ac99773f573613d145752b2984dddd13..da02ee027d690ae2b5c09de74436a4c15acfc6ab 100644 (file)
@@ -32,7 +32,7 @@
  *  - name of entries.
  */
 struct snmp_mib {
-       char *name;
+       const char *name;
        int entry;
 };
 
index f25542c48b7d938ebdbe77f0f4d6ac1e9f1c17cc..1b09a6dde7c00e02c7293f866210c50ad995db61 100644 (file)
@@ -127,8 +127,8 @@ static const struct snmp_mib snmp4_ipextstats_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct {
-       char *name;
+static const struct {
+       const char *name;
        int index;
 } icmpmibmap[] = {
        { "DestUnreachs", ICMP_DEST_UNREACH },
index 02f20016b4c947791d4964653eab63720d7943fc..bfe2598dd56386736aaf8c857b641f5b2d2c15f7 100644 (file)
@@ -59,7 +59,7 @@ static const struct file_operations sockstat6_seq_fops = {
        .release = single_release_net,
 };
 
-static struct snmp_mib snmp6_ipstats_list[] = {
+static const struct snmp_mib snmp6_ipstats_list[] = {
 /* ipv6 mib according to RFC 2465 */
        SNMP_MIB_ITEM("Ip6InReceives", IPSTATS_MIB_INPKTS),
        SNMP_MIB_ITEM("Ip6InHdrErrors", IPSTATS_MIB_INHDRERRORS),
@@ -92,7 +92,7 @@ static struct snmp_mib snmp6_ipstats_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp6_icmp6_list[] = {
+static const struct snmp_mib snmp6_icmp6_list[] = {
 /* icmpv6 mib according to RFC 2466 */
        SNMP_MIB_ITEM("Icmp6InMsgs", ICMP6_MIB_INMSGS),
        SNMP_MIB_ITEM("Icmp6InErrors", ICMP6_MIB_INERRORS),
@@ -120,7 +120,7 @@ static const char *const icmp6type2name[256] = {
 };
 
 
-static struct snmp_mib snmp6_udp6_list[] = {
+static const struct snmp_mib snmp6_udp6_list[] = {
        SNMP_MIB_ITEM("Udp6InDatagrams", UDP_MIB_INDATAGRAMS),
        SNMP_MIB_ITEM("Udp6NoPorts", UDP_MIB_NOPORTS),
        SNMP_MIB_ITEM("Udp6InErrors", UDP_MIB_INERRORS),
@@ -128,7 +128,7 @@ static struct snmp_mib snmp6_udp6_list[] = {
        SNMP_MIB_SENTINEL
 };
 
-static struct snmp_mib snmp6_udplite6_list[] = {
+static const struct snmp_mib snmp6_udplite6_list[] = {
        SNMP_MIB_ITEM("UdpLite6InDatagrams", UDP_MIB_INDATAGRAMS),
        SNMP_MIB_ITEM("UdpLite6NoPorts", UDP_MIB_NOPORTS),
        SNMP_MIB_ITEM("UdpLite6InErrors", UDP_MIB_INERRORS),
@@ -170,8 +170,8 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
        return;
 }
 
-static inline void
-snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_mib *itemlist)
+static void snmp6_seq_show_item(struct seq_file *seq, void **mib,
+                               const struct snmp_mib *itemlist)
 {
        int i;
        for (i=0; itemlist[i].name; i++)
index d093cbfeaac449855fcb89fcb87fe74daa523d90..a5ac6e0a8d9c11f1b40c191cbebf6e21ca14d0ef 100644 (file)
@@ -40,7 +40,7 @@
 #include <net/sctp/sctp.h>
 #include <net/ip.h> /* for snmp_fold_field */
 
-static struct snmp_mib sctp_snmp_list[] = {
+static const struct snmp_mib sctp_snmp_list[] = {
        SNMP_MIB_ITEM("SctpCurrEstab", SCTP_MIB_CURRESTAB),
        SNMP_MIB_ITEM("SctpActiveEstabs", SCTP_MIB_ACTIVEESTABS),
        SNMP_MIB_ITEM("SctpPassiveEstabs", SCTP_MIB_PASSIVEESTABS),
index fef8db553e8d63b3f0859459f59d0c4103663ad3..c083a4e4e796d277511ff7c90d8d8b2d3d7a7cb5 100644 (file)
@@ -15,7 +15,7 @@
 #include <net/snmp.h>
 #include <net/xfrm.h>
 
-static struct snmp_mib xfrm_mib_list[] = {
+static const struct snmp_mib xfrm_mib_list[] = {
        SNMP_MIB_ITEM("XfrmInError", LINUX_MIB_XFRMINERROR),
        SNMP_MIB_ITEM("XfrmInBufferError", LINUX_MIB_XFRMINBUFFERERROR),
        SNMP_MIB_ITEM("XfrmInHdrError", LINUX_MIB_XFRMINHDRERROR),