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
@@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(dccp_done);
|
||||
|
||||
const char *dccp_packet_name(const int type)
|
||||
{
|
||||
static const char *dccp_packet_names[] = {
|
||||
static const char *const dccp_packet_names[] = {
|
||||
[DCCP_PKT_REQUEST] = "REQUEST",
|
||||
[DCCP_PKT_RESPONSE] = "RESPONSE",
|
||||
[DCCP_PKT_DATA] = "DATA",
|
||||
@@ -147,7 +147,7 @@ EXPORT_SYMBOL_GPL(dccp_packet_name);
|
||||
|
||||
const char *dccp_state_name(const int state)
|
||||
{
|
||||
static char *dccp_state_names[] = {
|
||||
static const char *const dccp_state_names[] = {
|
||||
[DCCP_OPEN] = "OPEN",
|
||||
[DCCP_REQUESTING] = "REQUESTING",
|
||||
[DCCP_PARTOPEN] = "PARTOPEN",
|
||||
|
Reference in New Issue
Block a user