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/dccp | |
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/dccp')
-rw-r--r-- | net/dccp/ccids/ccid3.c | 4 | ||||
-rw-r--r-- | net/dccp/feat.c | 7 | ||||
-rw-r--r-- | net/dccp/proto.c | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index a27b7f4c19c5..f596ce149c3c 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -52,7 +52,7 @@ static int ccid3_debug; | |||
52 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG | 52 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG |
53 | static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state) | 53 | static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state) |
54 | { | 54 | { |
55 | static char *ccid3_state_names[] = { | 55 | static const char *const ccid3_state_names[] = { |
56 | [TFRC_SSTATE_NO_SENT] = "NO_SENT", | 56 | [TFRC_SSTATE_NO_SENT] = "NO_SENT", |
57 | [TFRC_SSTATE_NO_FBACK] = "NO_FBACK", | 57 | [TFRC_SSTATE_NO_FBACK] = "NO_FBACK", |
58 | [TFRC_SSTATE_FBACK] = "FBACK", | 58 | [TFRC_SSTATE_FBACK] = "FBACK", |
@@ -646,7 +646,7 @@ enum ccid3_fback_type { | |||
646 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG | 646 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG |
647 | static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state) | 647 | static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state) |
648 | { | 648 | { |
649 | static char *ccid3_rx_state_names[] = { | 649 | static const char *const ccid3_rx_state_names[] = { |
650 | [TFRC_RSTATE_NO_DATA] = "NO_DATA", | 650 | [TFRC_RSTATE_NO_DATA] = "NO_DATA", |
651 | [TFRC_RSTATE_DATA] = "DATA", | 651 | [TFRC_RSTATE_DATA] = "DATA", |
652 | [TFRC_RSTATE_TERM] = "TERM", | 652 | [TFRC_RSTATE_TERM] = "TERM", |
diff --git a/net/dccp/feat.c b/net/dccp/feat.c index b04160a2eea5..972b8dc918d6 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c | |||
@@ -213,7 +213,7 @@ static int dccp_feat_default_value(u8 feat_num) | |||
213 | */ | 213 | */ |
214 | static const char *dccp_feat_fname(const u8 feat) | 214 | static const char *dccp_feat_fname(const u8 feat) |
215 | { | 215 | { |
216 | static const char *feature_names[] = { | 216 | static const char *const feature_names[] = { |
217 | [DCCPF_RESERVED] = "Reserved", | 217 | [DCCPF_RESERVED] = "Reserved", |
218 | [DCCPF_CCID] = "CCID", | 218 | [DCCPF_CCID] = "CCID", |
219 | [DCCPF_SHORT_SEQNOS] = "Allow Short Seqnos", | 219 | [DCCPF_SHORT_SEQNOS] = "Allow Short Seqnos", |
@@ -236,8 +236,9 @@ static const char *dccp_feat_fname(const u8 feat) | |||
236 | return feature_names[feat]; | 236 | return feature_names[feat]; |
237 | } | 237 | } |
238 | 238 | ||
239 | static const char *dccp_feat_sname[] = { "DEFAULT", "INITIALISING", "CHANGING", | 239 | static const char *const dccp_feat_sname[] = { |
240 | "UNSTABLE", "STABLE" }; | 240 | "DEFAULT", "INITIALISING", "CHANGING", "UNSTABLE", "STABLE", |
241 | }; | ||
241 | 242 | ||
242 | #ifdef CONFIG_IP_DCCP_DEBUG | 243 | #ifdef CONFIG_IP_DCCP_DEBUG |
243 | static const char *dccp_feat_oname(const u8 opt) | 244 | static const char *dccp_feat_oname(const u8 opt) |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 94ca8eaace7d..37b3b4293ef4 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(dccp_done); | |||
124 | 124 | ||
125 | const char *dccp_packet_name(const int type) | 125 | const char *dccp_packet_name(const int type) |
126 | { | 126 | { |
127 | static const char *dccp_packet_names[] = { | 127 | static const char *const dccp_packet_names[] = { |
128 | [DCCP_PKT_REQUEST] = "REQUEST", | 128 | [DCCP_PKT_REQUEST] = "REQUEST", |
129 | [DCCP_PKT_RESPONSE] = "RESPONSE", | 129 | [DCCP_PKT_RESPONSE] = "RESPONSE", |
130 | [DCCP_PKT_DATA] = "DATA", | 130 | [DCCP_PKT_DATA] = "DATA", |
@@ -147,7 +147,7 @@ EXPORT_SYMBOL_GPL(dccp_packet_name); | |||
147 | 147 | ||
148 | const char *dccp_state_name(const int state) | 148 | const char *dccp_state_name(const int state) |
149 | { | 149 | { |
150 | static char *dccp_state_names[] = { | 150 | static const char *const dccp_state_names[] = { |
151 | [DCCP_OPEN] = "OPEN", | 151 | [DCCP_OPEN] = "OPEN", |
152 | [DCCP_REQUESTING] = "REQUESTING", | 152 | [DCCP_REQUESTING] = "REQUESTING", |
153 | [DCCP_PARTOPEN] = "PARTOPEN", | 153 | [DCCP_PARTOPEN] = "PARTOPEN", |