diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2009-08-05 13:42:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-05 13:42:58 -0400 |
commit | 36cbd3dcc10384f813ec0814255f576c84f2bcd4 (patch) | |
tree | c3579edea972519d2f9ae99d7da9a5dd56e6f5c1 /net/atm | |
parent | db71789c01ae7b641f83c5aa64e7df25122f4b28 (diff) |
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>
Diffstat (limited to 'net/atm')
-rw-r--r-- | net/atm/lec.c | 9 | ||||
-rw-r--r-- | net/atm/proc.c | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c index c463868c993b..8e723c2654cb 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -935,9 +935,9 @@ static int lecd_attach(struct atm_vcc *vcc, int arg) | |||
935 | } | 935 | } |
936 | 936 | ||
937 | #ifdef CONFIG_PROC_FS | 937 | #ifdef CONFIG_PROC_FS |
938 | static char *lec_arp_get_status_string(unsigned char status) | 938 | static const char *lec_arp_get_status_string(unsigned char status) |
939 | { | 939 | { |
940 | static char *lec_arp_status_string[] = { | 940 | static const char *const lec_arp_status_string[] = { |
941 | "ESI_UNKNOWN ", | 941 | "ESI_UNKNOWN ", |
942 | "ESI_ARP_PENDING ", | 942 | "ESI_ARP_PENDING ", |
943 | "ESI_VC_PENDING ", | 943 | "ESI_VC_PENDING ", |
@@ -1121,7 +1121,8 @@ static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1121 | 1121 | ||
1122 | static int lec_seq_show(struct seq_file *seq, void *v) | 1122 | static int lec_seq_show(struct seq_file *seq, void *v) |
1123 | { | 1123 | { |
1124 | static char lec_banner[] = "Itf MAC ATM destination" | 1124 | static const char lec_banner[] = |
1125 | "Itf MAC ATM destination" | ||
1125 | " Status Flags " | 1126 | " Status Flags " |
1126 | "VPI/VCI Recv VPI/VCI\n"; | 1127 | "VPI/VCI Recv VPI/VCI\n"; |
1127 | 1128 | ||
@@ -1505,7 +1506,7 @@ lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove) | |||
1505 | } | 1506 | } |
1506 | 1507 | ||
1507 | #if DEBUG_ARP_TABLE | 1508 | #if DEBUG_ARP_TABLE |
1508 | static char *get_status_string(unsigned char st) | 1509 | static const char *get_status_string(unsigned char st) |
1509 | { | 1510 | { |
1510 | switch (st) { | 1511 | switch (st) { |
1511 | case ESI_UNKNOWN: | 1512 | case ESI_UNKNOWN: |
diff --git a/net/atm/proc.c b/net/atm/proc.c index 38de5ff61ecd..ab8419a324b6 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c | |||
@@ -151,8 +151,9 @@ static void *vcc_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
151 | 151 | ||
152 | static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) | 152 | static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) |
153 | { | 153 | { |
154 | static const char *class_name[] = { "off","UBR","CBR","VBR","ABR" }; | 154 | static const char *const class_name[] = |
155 | static const char *aal_name[] = { | 155 | {"off","UBR","CBR","VBR","ABR"}; |
156 | static const char *const aal_name[] = { | ||
156 | "---", "1", "2", "3/4", /* 0- 3 */ | 157 | "---", "1", "2", "3/4", /* 0- 3 */ |
157 | "???", "5", "???", "???", /* 4- 7 */ | 158 | "???", "5", "???", "???", /* 4- 7 */ |
158 | "???", "???", "???", "???", /* 8-11 */ | 159 | "???", "???", "???", "???", /* 8-11 */ |
@@ -178,7 +179,7 @@ static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) | |||
178 | 179 | ||
179 | static const char *vcc_state(struct atm_vcc *vcc) | 180 | static const char *vcc_state(struct atm_vcc *vcc) |
180 | { | 181 | { |
181 | static const char *map[] = { ATM_VS2TXT_MAP }; | 182 | static const char *const map[] = { ATM_VS2TXT_MAP }; |
182 | 183 | ||
183 | return map[ATM_VF2VS(vcc->flags)]; | 184 | return map[ATM_VF2VS(vcc->flags)]; |
184 | } | 185 | } |
@@ -335,7 +336,7 @@ static const struct file_operations vcc_seq_fops = { | |||
335 | 336 | ||
336 | static int svc_seq_show(struct seq_file *seq, void *v) | 337 | static int svc_seq_show(struct seq_file *seq, void *v) |
337 | { | 338 | { |
338 | static char atm_svc_banner[] = | 339 | static const char atm_svc_banner[] = |
339 | "Itf VPI VCI State Remote\n"; | 340 | "Itf VPI VCI State Remote\n"; |
340 | 341 | ||
341 | if (v == SEQ_START_TOKEN) | 342 | if (v == SEQ_START_TOKEN) |