net: mark read-only arrays as const
String literals are constant, and usually, we can also tag the array of pointers const too, moving it to the .rodata section. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
db71789c01
commit
36cbd3dcc1
@ -127,7 +127,8 @@ ip_vs_create_timeout_table(int *table, int size)
|
||||
* Set timeout value for state specified by name
|
||||
*/
|
||||
int
|
||||
ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to)
|
||||
ip_vs_set_state_timeout(int *table, int num, const char *const *names,
|
||||
const char *name, int to)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -377,7 +377,7 @@ static int tcp_timeouts[IP_VS_TCP_S_LAST+1] = {
|
||||
[IP_VS_TCP_S_LAST] = 2*HZ,
|
||||
};
|
||||
|
||||
static char * tcp_state_name_table[IP_VS_TCP_S_LAST+1] = {
|
||||
static const char *const tcp_state_name_table[IP_VS_TCP_S_LAST+1] = {
|
||||
[IP_VS_TCP_S_NONE] = "NONE",
|
||||
[IP_VS_TCP_S_ESTABLISHED] = "ESTABLISHED",
|
||||
[IP_VS_TCP_S_SYN_SENT] = "SYN_SENT",
|
||||
|
@ -472,7 +472,7 @@ static int udp_timeouts[IP_VS_UDP_S_LAST+1] = {
|
||||
[IP_VS_UDP_S_LAST] = 2*HZ,
|
||||
};
|
||||
|
||||
static char * udp_state_name_table[IP_VS_UDP_S_LAST+1] = {
|
||||
static const char *const udp_state_name_table[IP_VS_UDP_S_LAST+1] = {
|
||||
[IP_VS_UDP_S_NORMAL] = "UDP",
|
||||
[IP_VS_UDP_S_LAST] = "BUG!",
|
||||
};
|
||||
|
Reference in New Issue
Block a user