Skip to content

Commit

Permalink
net: constify MIB name tables
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Alexey Dobriyan authored and davem330 committed Jan 23, 2010
1 parent 81c1ebf commit 5833929
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/net/snmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* - name of entries.
*/
struct snmp_mib {
char *name;
const char *name;
int entry;
};

Expand Down
4 changes: 2 additions & 2 deletions net/ipv4/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
12 changes: 6 additions & 6 deletions net/ipv6/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -120,15 +120,15 @@ 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),
SNMP_MIB_ITEM("Udp6OutDatagrams", UDP_MIB_OUTDATAGRAMS),
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),
Expand Down Expand Up @@ -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++)
Expand Down
2 changes: 1 addition & 1 deletion net/sctp/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 5833929

Please sign in to comment.