[NET]: Add const markers to various variables.
the patch below marks various variables const in net/; the goal is to move them to the .rodata section so that they can't false-share cachelines with things that get written to, as well as potentially helping gcc a bit with optimisations. (these were found using a gcc patch to warn about such variables) Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
fb29644994
commit
9b5b5cff9a
@@ -98,7 +98,7 @@ fold_field(void *mib[], int offt)
|
||||
}
|
||||
|
||||
/* snmp items */
|
||||
static struct snmp_mib snmp4_ipstats_list[] = {
|
||||
static const struct snmp_mib snmp4_ipstats_list[] = {
|
||||
SNMP_MIB_ITEM("InReceives", IPSTATS_MIB_INRECEIVES),
|
||||
SNMP_MIB_ITEM("InHdrErrors", IPSTATS_MIB_INHDRERRORS),
|
||||
SNMP_MIB_ITEM("InAddrErrors", IPSTATS_MIB_INADDRERRORS),
|
||||
@@ -119,7 +119,7 @@ static struct snmp_mib snmp4_ipstats_list[] = {
|
||||
SNMP_MIB_SENTINEL
|
||||
};
|
||||
|
||||
static struct snmp_mib snmp4_icmp_list[] = {
|
||||
static const struct snmp_mib snmp4_icmp_list[] = {
|
||||
SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS),
|
||||
SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS),
|
||||
SNMP_MIB_ITEM("InDestUnreachs", ICMP_MIB_INDESTUNREACHS),
|
||||
@@ -149,7 +149,7 @@ static struct snmp_mib snmp4_icmp_list[] = {
|
||||
SNMP_MIB_SENTINEL
|
||||
};
|
||||
|
||||
static struct snmp_mib snmp4_tcp_list[] = {
|
||||
static const struct snmp_mib snmp4_tcp_list[] = {
|
||||
SNMP_MIB_ITEM("RtoAlgorithm", TCP_MIB_RTOALGORITHM),
|
||||
SNMP_MIB_ITEM("RtoMin", TCP_MIB_RTOMIN),
|
||||
SNMP_MIB_ITEM("RtoMax", TCP_MIB_RTOMAX),
|
||||
@@ -167,7 +167,7 @@ static struct snmp_mib snmp4_tcp_list[] = {
|
||||
SNMP_MIB_SENTINEL
|
||||
};
|
||||
|
||||
static struct snmp_mib snmp4_udp_list[] = {
|
||||
static const struct snmp_mib snmp4_udp_list[] = {
|
||||
SNMP_MIB_ITEM("InDatagrams", UDP_MIB_INDATAGRAMS),
|
||||
SNMP_MIB_ITEM("NoPorts", UDP_MIB_NOPORTS),
|
||||
SNMP_MIB_ITEM("InErrors", UDP_MIB_INERRORS),
|
||||
@@ -175,7 +175,7 @@ static struct snmp_mib snmp4_udp_list[] = {
|
||||
SNMP_MIB_SENTINEL
|
||||
};
|
||||
|
||||
static struct snmp_mib snmp4_net_list[] = {
|
||||
static const struct snmp_mib snmp4_net_list[] = {
|
||||
SNMP_MIB_ITEM("SyncookiesSent", LINUX_MIB_SYNCOOKIESSENT),
|
||||
SNMP_MIB_ITEM("SyncookiesRecv", LINUX_MIB_SYNCOOKIESRECV),
|
||||
SNMP_MIB_ITEM("SyncookiesFailed", LINUX_MIB_SYNCOOKIESFAILED),
|
||||
|
Reference in New Issue
Block a user