net: mark read-only arrays as const
authorJan Engelhardt <jengelh@medozas.de>
Wed, 5 Aug 2009 17:42:58 +0000 (10:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Aug 2009 17:42:58 +0000 (10:42 -0700)
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>
36 files changed:
include/net/ip_vs.h
include/net/irda/ircomm_event.h
include/net/irda/ircomm_tty_attach.h
include/net/irda/irlap_event.h
include/net/irda/irlmp_event.h
include/net/sctp/constants.h
net/8021q/vlanproc.c
net/atm/lec.c
net/atm/proc.c
net/bluetooth/af_bluetooth.c
net/bridge/br_stp.c
net/core/dev.c
net/core/net-sysfs.c
net/core/sock.c
net/dccp/ccids/ccid3.c
net/dccp/feat.c
net/dccp/proto.c
net/ipv4/fib_trie.c
net/ipv6/proc.c
net/irda/ircomm/ircomm_event.c
net/irda/ircomm/ircomm_tty_attach.c
net/irda/iriap.c
net/irda/irlan/irlan_common.c
net/irda/irlap.c
net/irda/irlap_event.c
net/irda/irlmp_event.c
net/llc/llc_proc.c
net/netfilter/ipvs/ip_vs_proto.c
net/netfilter/ipvs/ip_vs_proto_tcp.c
net/netfilter/ipvs/ip_vs_proto_udp.c
net/rds/ib_stats.c
net/rds/iw_stats.c
net/rds/rds.h
net/rds/stats.c
net/rxrpc/ar-ack.c
net/sctp/debug.c

index 1c8ee1b1365171d8e4e5400ee5870759b9d250fc..98978e73f666ae83bb93d35aba88196678205ed0 100644 (file)
@@ -738,7 +738,8 @@ extern void ip_vs_protocol_cleanup(void);
 extern void ip_vs_protocol_timeout_change(int flags);
 extern int *ip_vs_create_timeout_table(int *table, int size);
 extern 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);
 extern void
 ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb,
                          int offset, const char *msg);
index c290447872d1f483b68c25ad40f9b2005e84cf25..bc0c6f31f1c6204d41f983c1ce3434d7f8d77258 100644 (file)
@@ -74,7 +74,7 @@ struct ircomm_info {
        struct qos_info *qos;
 };
 
-extern char *ircomm_state[];
+extern const char *const ircomm_state[];
 
 struct ircomm_cb;   /* Forward decl. */
 
index f91a5695aa449671fde1a0d0171b7fb3aa04c9cb..0a63bbb972d7152c1daa9c9d0d058e58954cf0ad 100644 (file)
@@ -66,8 +66,8 @@ struct ircomm_tty_info {
         __u8      dlsap_sel;
 };
 
-extern char *ircomm_state[];
-extern char *ircomm_tty_state[];
+extern const char *const ircomm_state[];
+extern const char *const ircomm_tty_state[];
 
 int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
                        struct sk_buff *skb, struct ircomm_tty_info *info);
index 2ae2e119ef4bf6334ea6c6bd38ea46d9489bd75c..4c90824c50fb1ee002aa6e82f50f32fe0c2b940a 100644 (file)
@@ -120,7 +120,7 @@ typedef enum { /* FIXME check the two first reason codes */
        LAP_PRIMARY_CONFLICT,
 } LAP_REASON;
 
-extern const char *irlap_state[];
+extern const char *const irlap_state[];
 
 void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, 
                    struct sk_buff *skb, struct irlap_info *info);
index e03ae4ae3963fa112606e8f372fa0a4083e40bbb..9e4ec17a74497266af494aaf6f3ba351d27ee040 100644 (file)
@@ -79,8 +79,8 @@ typedef enum {
        LM_LAP_IDLE_TIMEOUT,
 } IRLMP_EVENT;
 
-extern const char *irlmp_state[];
-extern const char *irlsap_state[];
+extern const char *const irlmp_state[];
+extern const char *const irlsap_state[];
 
 void irlmp_watchdog_timer_expired(void *data);
 void irlmp_discovery_timer_expired(void *data);
index b05b0557211f00ee05cd5d27c3313c59072e1df3..8bc25f7b04cea5defec02a23bcbbc331647b80d4 100644 (file)
@@ -241,7 +241,9 @@ const char *sctp_tname(const sctp_subtype_t);       /* timeouts */
 const char *sctp_pname(const sctp_subtype_t);  /* primitives */
 
 /* This is a table of printable names of sctp_state_t's.  */
-extern const char *sctp_state_tbl[], *sctp_evttype_tbl[], *sctp_status_tbl[];
+extern const char *const sctp_state_tbl[];
+extern const char *const sctp_evttype_tbl[];
+extern const char *const sctp_status_tbl[];
 
 /* Maximum chunk length considering padding requirements. */
 enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) };
index b55a091a33dfb98fa0110c45df263772ce58c763..6262c335f3c278b7a4fd171fe85cd5d23bbff2e3 100644 (file)
@@ -107,7 +107,7 @@ static const struct file_operations vlandev_fops = {
  */
 
 /* Strings */
-static const char *vlan_name_type_str[VLAN_NAME_TYPE_HIGHEST] = {
+static const char *const vlan_name_type_str[VLAN_NAME_TYPE_HIGHEST] = {
     [VLAN_NAME_TYPE_RAW_PLUS_VID]        = "VLAN_NAME_TYPE_RAW_PLUS_VID",
     [VLAN_NAME_TYPE_PLUS_VID_NO_PAD]    = "VLAN_NAME_TYPE_PLUS_VID_NO_PAD",
     [VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD] = "VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD",
index c463868c993ba7ff1962df4f6b9239d839ad5271..8e723c2654cb82f50f4376291be41ce49d988de9 100644 (file)
@@ -935,9 +935,9 @@ static int lecd_attach(struct atm_vcc *vcc, int arg)
 }
 
 #ifdef CONFIG_PROC_FS
-static char *lec_arp_get_status_string(unsigned char status)
+static const char *lec_arp_get_status_string(unsigned char status)
 {
-       static char *lec_arp_status_string[] = {
+       static const char *const lec_arp_status_string[] = {
                "ESI_UNKNOWN       ",
                "ESI_ARP_PENDING   ",
                "ESI_VC_PENDING    ",
@@ -1121,7 +1121,8 @@ static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 
 static int lec_seq_show(struct seq_file *seq, void *v)
 {
-       static char lec_banner[] = "Itf  MAC          ATM destination"
+       static const char lec_banner[] =
+           "Itf  MAC          ATM destination"
            "                          Status            Flags "
            "VPI/VCI Recv VPI/VCI\n";
 
@@ -1505,7 +1506,7 @@ lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove)
 }
 
 #if DEBUG_ARP_TABLE
-static char *get_status_string(unsigned char st)
+static const char *get_status_string(unsigned char st)
 {
        switch (st) {
        case ESI_UNKNOWN:
index 38de5ff61ecde7b94b79605038b0c300450f75cd..ab8419a324b61556de9f353b8d6d6569704803ab 100644 (file)
@@ -151,8 +151,9 @@ static void *vcc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 
 static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc)
 {
-       static const char *class_name[] = { "off","UBR","CBR","VBR","ABR" };
-       static const char *aal_name[] = {
+       static const char *const class_name[] =
+               {"off","UBR","CBR","VBR","ABR"};
+       static const char *const aal_name[] = {
                "---",  "1",    "2",    "3/4",  /*  0- 3 */
                "???",  "5",    "???",  "???",  /*  4- 7 */
                "???",  "???",  "???",  "???",  /*  8-11 */
@@ -178,7 +179,7 @@ static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc)
 
 static const char *vcc_state(struct atm_vcc *vcc)
 {
-       static const char *map[] = { ATM_VS2TXT_MAP };
+       static const char *const map[] = { ATM_VS2TXT_MAP };
 
        return map[ATM_VF2VS(vcc->flags)];
 }
@@ -335,7 +336,7 @@ static const struct file_operations vcc_seq_fops = {
 
 static int svc_seq_show(struct seq_file *seq, void *v)
 {
-       static char atm_svc_banner[] =
+       static const char atm_svc_banner[] =
                "Itf VPI VCI           State      Remote\n";
 
        if (v == SEQ_START_TOKEN)
index 0250e0600150a464c8b3a1ecf8f56f7cff41f867..8cfb5a8498412461fa52278a8a94423580167de6 100644 (file)
@@ -49,7 +49,7 @@ static struct net_proto_family *bt_proto[BT_MAX_PROTO];
 static DEFINE_RWLOCK(bt_proto_lock);
 
 static struct lock_class_key bt_lock_key[BT_MAX_PROTO];
-static const char *bt_key_strings[BT_MAX_PROTO] = {
+static const char *const bt_key_strings[BT_MAX_PROTO] = {
        "sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP",
        "sk_lock-AF_BLUETOOTH-BTPROTO_HCI",
        "sk_lock-AF_BLUETOOTH-BTPROTO_SCO",
@@ -61,7 +61,7 @@ static const char *bt_key_strings[BT_MAX_PROTO] = {
 };
 
 static struct lock_class_key bt_slock_key[BT_MAX_PROTO];
-static const char *bt_slock_key_strings[BT_MAX_PROTO] = {
+static const char *const bt_slock_key_strings[BT_MAX_PROTO] = {
        "slock-AF_BLUETOOTH-BTPROTO_L2CAP",
        "slock-AF_BLUETOOTH-BTPROTO_HCI",
        "slock-AF_BLUETOOTH-BTPROTO_SCO",
index 0660515f3992fe460c8a0de96c7d3632aec707c3..fd3f8d6c0998adaa1c3c64f506c72ec8bae9b7b6 100644 (file)
@@ -21,7 +21,7 @@
  */
 #define MESSAGE_AGE_INCR       ((HZ < 256) ? 1 : (HZ/256))
 
-static const char *br_port_state_names[] = {
+static const char *const br_port_state_names[] = {
        [BR_STATE_DISABLED] = "disabled",
        [BR_STATE_LISTENING] = "listening",
        [BR_STATE_LEARNING] = "learning",
index 71347668c506f8d02a6663c4dc675a9daffaf812..f01a9c41f1128b334c0aa56de9b35b2828896961 100644 (file)
@@ -272,7 +272,7 @@ static const unsigned short netdev_lock_type[] =
         ARPHRD_PHONET_PIPE, ARPHRD_IEEE802154, ARPHRD_IEEE802154_PHY,
         ARPHRD_VOID, ARPHRD_NONE};
 
-static const char *netdev_lock_name[] =
+static const char *const netdev_lock_name[] =
        {"_xmit_NETROM", "_xmit_ETHER", "_xmit_EETHER", "_xmit_AX25",
         "_xmit_PRONET", "_xmit_CHAOS", "_xmit_IEEE802", "_xmit_ARCNET",
         "_xmit_APPLETLK", "_xmit_DLCI", "_xmit_ATM", "_xmit_METRICOM",
index 3994680c08b976f1d54a626f2ed14bcac770684c..ad91e9e5f475c10b592912678e9ef22d2591a6ca 100644 (file)
@@ -141,7 +141,7 @@ static ssize_t show_dormant(struct device *dev,
        return -EINVAL;
 }
 
-static const char *operstates[] = {
+static const char *const operstates[] = {
        "unknown",
        "notpresent", /* currently unused */
        "down",
index bbb25be7ddfe614432ca8627ba4cbe791f57d569..a324a80c163ef6c25099dcb53ea431caa98121e3 100644 (file)
@@ -142,7 +142,7 @@ static struct lock_class_key af_family_slock_keys[AF_MAX];
  * strings build-time, so that runtime initialization of socket
  * locks is fast):
  */
-static const char *af_family_key_strings[AF_MAX+1] = {
+static const char *const af_family_key_strings[AF_MAX+1] = {
   "sk_lock-AF_UNSPEC", "sk_lock-AF_UNIX"     , "sk_lock-AF_INET"     ,
   "sk_lock-AF_AX25"  , "sk_lock-AF_IPX"      , "sk_lock-AF_APPLETALK",
   "sk_lock-AF_NETROM", "sk_lock-AF_BRIDGE"   , "sk_lock-AF_ATMPVC"   ,
@@ -158,7 +158,7 @@ static const char *af_family_key_strings[AF_MAX+1] = {
   "sk_lock-AF_IEEE802154",
   "sk_lock-AF_MAX"
 };
-static const char *af_family_slock_key_strings[AF_MAX+1] = {
+static const char *const af_family_slock_key_strings[AF_MAX+1] = {
   "slock-AF_UNSPEC", "slock-AF_UNIX"     , "slock-AF_INET"     ,
   "slock-AF_AX25"  , "slock-AF_IPX"      , "slock-AF_APPLETALK",
   "slock-AF_NETROM", "slock-AF_BRIDGE"   , "slock-AF_ATMPVC"   ,
@@ -174,7 +174,7 @@ static const char *af_family_slock_key_strings[AF_MAX+1] = {
   "slock-AF_IEEE802154",
   "slock-AF_MAX"
 };
-static const char *af_family_clock_key_strings[AF_MAX+1] = {
+static const char *const af_family_clock_key_strings[AF_MAX+1] = {
   "clock-AF_UNSPEC", "clock-AF_UNIX"     , "clock-AF_INET"     ,
   "clock-AF_AX25"  , "clock-AF_IPX"      , "clock-AF_APPLETALK",
   "clock-AF_NETROM", "clock-AF_BRIDGE"   , "clock-AF_ATMPVC"   ,
index a27b7f4c19c509ba5aaefd01b37935cc78600c20..f596ce149c3c00a18ae4213d7f5c9e6d86bd1df6 100644 (file)
@@ -52,7 +52,7 @@ static int ccid3_debug;
 #ifdef CONFIG_IP_DCCP_CCID3_DEBUG
 static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state)
 {
-       static char *ccid3_state_names[] = {
+       static const char *const ccid3_state_names[] = {
        [TFRC_SSTATE_NO_SENT]  = "NO_SENT",
        [TFRC_SSTATE_NO_FBACK] = "NO_FBACK",
        [TFRC_SSTATE_FBACK]    = "FBACK",
@@ -646,7 +646,7 @@ enum ccid3_fback_type {
 #ifdef CONFIG_IP_DCCP_CCID3_DEBUG
 static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state)
 {
-       static char *ccid3_rx_state_names[] = {
+       static const char *const ccid3_rx_state_names[] = {
        [TFRC_RSTATE_NO_DATA] = "NO_DATA",
        [TFRC_RSTATE_DATA]    = "DATA",
        [TFRC_RSTATE_TERM]    = "TERM",
index b04160a2eea551e0ddb3d18b89f60674328f105b..972b8dc918d6ab90d5d11f55f2e2e7c585def32a 100644 (file)
@@ -213,7 +213,7 @@ static int dccp_feat_default_value(u8 feat_num)
  */
 static const char *dccp_feat_fname(const u8 feat)
 {
-       static const char *feature_names[] = {
+       static const char *const feature_names[] = {
                [DCCPF_RESERVED]        = "Reserved",
                [DCCPF_CCID]            = "CCID",
                [DCCPF_SHORT_SEQNOS]    = "Allow Short Seqnos",
@@ -236,8 +236,9 @@ static const char *dccp_feat_fname(const u8 feat)
        return feature_names[feat];
 }
 
-static const char *dccp_feat_sname[] = { "DEFAULT", "INITIALISING", "CHANGING",
-                                        "UNSTABLE", "STABLE" };
+static const char *const dccp_feat_sname[] = {
+       "DEFAULT", "INITIALISING", "CHANGING", "UNSTABLE", "STABLE",
+};
 
 #ifdef CONFIG_IP_DCCP_DEBUG
 static const char *dccp_feat_oname(const u8 opt)
index 94ca8eaace7d05988059838bd5477831d643b65f..37b3b4293ef4e415515fc6e88b96e7125acad86a 100644 (file)
@@ -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",
index d58b49115386f0ca0fd3ebddb2b0684728c117e6..fe3c846b99a6dc10fd8b575341ee70b758b3e5d3 100644 (file)
@@ -2421,7 +2421,7 @@ static inline const char *rtn_scope(char *buf, size_t len, enum rt_scope_t s)
        }
 }
 
-static const char *rtn_type_names[__RTN_MAX] = {
+static const char *const rtn_type_names[__RTN_MAX] = {
        [RTN_UNSPEC] = "UNSPEC",
        [RTN_UNICAST] = "UNICAST",
        [RTN_LOCAL] = "LOCAL",
index 590ddefb7ffcb3b91e5d54ac41c01e9a2bcbcfe2..c9605c3ad91fcf8927c4df2937fa10c8b8dafd94 100644 (file)
@@ -101,7 +101,7 @@ static struct snmp_mib snmp6_icmp6_list[] = {
 };
 
 /* RFC 4293 v6 ICMPMsgStatsTable; named items for RFC 2466 compatibility */
-static char *icmp6type2name[256] = {
+static const char *const icmp6type2name[256] = {
        [ICMPV6_DEST_UNREACH] = "DestUnreachs",
        [ICMPV6_PKT_TOOBIG] = "PktTooBigs",
        [ICMPV6_TIME_EXCEED] = "TimeExcds",
@@ -144,7 +144,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
        /* print by name -- deprecated items */
        for (i = 0; i < ICMP6MSG_MIB_MAX; i++) {
                int icmptype;
-               char *p;
+               const char *p;
 
                icmptype = i & 0xff;
                p = icmp6type2name[icmptype];
index c35b3ef5c2f083778728b33e0657a946b0f05bfe..d78554fedbac5e98c32ac664bd595f1d35373fa5 100644 (file)
@@ -49,7 +49,7 @@ static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event,
 static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event,
                             struct sk_buff *skb, struct ircomm_info *info);
 
-char *ircomm_state[] = {
+const char *const ircomm_state[] = {
        "IRCOMM_IDLE",
        "IRCOMM_WAITI",
        "IRCOMM_WAITR",
@@ -57,7 +57,7 @@ char *ircomm_state[] = {
 };
 
 #ifdef CONFIG_IRDA_DEBUG
-static char *ircomm_event[] = {
+static const char *const ircomm_event[] = {
        "IRCOMM_CONNECT_REQUEST",
        "IRCOMM_CONNECT_RESPONSE",
        "IRCOMM_TTP_CONNECT_INDICATION",
index 9032a1d1190dfe57b7bccb0d4ae460a008f4ad8b..eafc010907c2d65c803b2285b8045a598fc00893 100644 (file)
@@ -80,7 +80,7 @@ static int ircomm_tty_state_ready(struct ircomm_tty_cb *self,
                                  struct sk_buff *skb,
                                  struct ircomm_tty_info *info);
 
-char *ircomm_tty_state[] = {
+const char *const ircomm_tty_state[] = {
        "IRCOMM_TTY_IDLE",
        "IRCOMM_TTY_SEARCH",
        "IRCOMM_TTY_QUERY_PARAMETERS",
@@ -91,7 +91,7 @@ char *ircomm_tty_state[] = {
 };
 
 #ifdef CONFIG_IRDA_DEBUG
-static char *ircomm_tty_event[] = {
+static const char *const ircomm_tty_event[] = {
        "IRCOMM_TTY_ATTACH_CABLE",
        "IRCOMM_TTY_DETACH_CABLE",
        "IRCOMM_TTY_DATA_REQUEST",
index 4a105dc32dcdd38275f45f299d866405b4fcadd1..294e34d3517cb87cc191c1cfec9d7b39de30245d 100644 (file)
@@ -44,7 +44,7 @@
 
 #ifdef CONFIG_IRDA_DEBUG
 /* FIXME: This one should go in irlmp.c */
-static const char *ias_charset_types[] = {
+static const char *const ias_charset_types[] = {
        "CS_ASCII",
        "CS_ISO_8859_1",
        "CS_ISO_8859_2",
@@ -966,7 +966,7 @@ static void iriap_watchdog_timer_expired(void *data)
 
 #ifdef CONFIG_PROC_FS
 
-static const char *ias_value_types[] = {
+static const char *const ias_value_types[] = {
        "IAS_MISSING",
        "IAS_INTEGER",
        "IAS_OCT_SEQ",
index 774d73a76852e1ce63262f8d2a1af343668473d5..62116829b817174fc7193289222ee820bbc83c1d 100644 (file)
@@ -69,14 +69,14 @@ static int eth;   /* Use "eth" or "irlan" name for devices */
 static int access = ACCESS_PEER; /* PEER, DIRECT or HOSTED */
 
 #ifdef CONFIG_PROC_FS
-static const char *irlan_access[] = {
+static const char *const irlan_access[] = {
        "UNKNOWN",
        "DIRECT",
        "PEER",
        "HOSTED"
 };
 
-static const char *irlan_media[] = {
+static const char *const irlan_media[] = {
        "UNKNOWN",
        "802.3",
        "802.5"
index e4965b764b9b72b9ed6626fd0eb13242c72f18f0..356e65b1dc42a372c5544edd9d808e534cfc4ee6 100644 (file)
@@ -63,7 +63,7 @@ static void irlap_init_qos_capabilities(struct irlap_cb *self,
                                        struct qos_info *qos_user);
 
 #ifdef CONFIG_IRDA_DEBUG
-static char *lap_reasons[] = {
+static const char *const lap_reasons[] = {
        "ERROR, NOT USED",
        "LAP_DISC_INDICATION",
        "LAP_NO_RESPONSE",
index 16c4ef0f5c1a85c2cef0d7994b43184a94ae654c..c5c51959e3ced8621ff5ad6f5e7fa9352aa16754 100644 (file)
@@ -78,7 +78,7 @@ static int irlap_state_reset_check(struct irlap_cb *, IRLAP_EVENT event,
                                   struct sk_buff *, struct irlap_info *);
 
 #ifdef CONFIG_IRDA_DEBUG
-static const char *irlap_event[] = {
+static const char *const irlap_event[] = {
        "DISCOVERY_REQUEST",
        "CONNECT_REQUEST",
        "CONNECT_RESPONSE",
@@ -120,7 +120,7 @@ static const char *irlap_event[] = {
 };
 #endif /* CONFIG_IRDA_DEBUG */
 
-const char *irlap_state[] = {
+const char *const irlap_state[] = {
        "LAP_NDM",
        "LAP_QUERY",
        "LAP_REPLY",
index 78cce0cb073f4b6a709887e58f762dc04eb2fe05..c1fb5db8104215642371b1ff664c96e4f4b62a6c 100644 (file)
 #include <net/irda/irlmp_frame.h>
 #include <net/irda/irlmp_event.h>
 
-const char *irlmp_state[] = {
+const char *const irlmp_state[] = {
        "LAP_STANDBY",
        "LAP_U_CONNECT",
        "LAP_ACTIVE",
 };
 
-const char *irlsap_state[] = {
+const char *const irlsap_state[] = {
        "LSAP_DISCONNECTED",
        "LSAP_CONNECT",
        "LSAP_CONNECT_PEND",
@@ -49,7 +49,7 @@ const char *irlsap_state[] = {
 };
 
 #ifdef CONFIG_IRDA_DEBUG
-static const char *irlmp_event[] = {
+static const char *const irlmp_event[] = {
        "LM_CONNECT_REQUEST",
        "LM_CONNECT_CONFIRM",
        "LM_CONNECT_RESPONSE",
index f97be471fe2edc38a7e180cdb74b80489aac2bdc..be47ac427f6b23afc23888081ab1edf89346c280 100644 (file)
@@ -143,7 +143,7 @@ out:
        return 0;
 }
 
-static char *llc_conn_state_names[] = {
+static const char *const llc_conn_state_names[] = {
        [LLC_CONN_STATE_ADM] =        "adm",
        [LLC_CONN_STATE_SETUP] =      "setup",
        [LLC_CONN_STATE_NORMAL] =     "normal",
index 85c8892e1e8be22fafb852b7579b4cd23a0cde58..3e7671674549585bf769a5c2f05b353d4adecd60 100644 (file)
@@ -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;
 
index 2278e141489e0d3f376892260ea73bc8d0433b88..91d28e073742db770bb5df2ee8ee123fb7afbc0a 100644 (file)
@@ -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",
index 33a05d3684d9d2e80cf9b46a21c26a79253c3c16..e7a6885e0167cc2a55d1fd4b71f2144c2ba46e54 100644 (file)
@@ -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!",
 };
index 02e3e3d50d4a3c952bb0817e0e596a94ccba1c61..8d8488306fe4979374dad7ac05fbc4b8b1e3a67c 100644 (file)
@@ -39,7 +39,7 @@
 
 DEFINE_PER_CPU(struct rds_ib_statistics, rds_ib_stats) ____cacheline_aligned;
 
-static char *rds_ib_stat_names[] = {
+static const char *const rds_ib_stat_names[] = {
        "ib_connect_raced",
        "ib_listen_closed_stale",
        "ib_tx_cq_call",
index ccc7e8f0bf0e09253be5cff4a5fd3002e6388b8b..d33ea790484ef24a43588543770e191429fa0c83 100644 (file)
@@ -39,7 +39,7 @@
 
 DEFINE_PER_CPU(struct rds_iw_statistics, rds_iw_stats) ____cacheline_aligned;
 
-static char *rds_iw_stat_names[] = {
+static const char *const rds_iw_stat_names[] = {
        "iw_connect_raced",
        "iw_listen_closed_stale",
        "iw_tx_cq_call",
index dbe111236783d81497a730f3765b6a748c60dacb..290566c69d2872bd8328026ea9799a4617071945 100644 (file)
@@ -652,7 +652,8 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats);
 int __init rds_stats_init(void);
 void rds_stats_exit(void);
 void rds_stats_info_copy(struct rds_info_iterator *iter,
-                        uint64_t *values, char **names, size_t nr);
+                        uint64_t *values, const char *const *names,
+                        size_t nr);
 
 /* sysctl.c */
 int __init rds_sysctl_init(void);
index 637146893cf3e24286404e43c1400492c5437cb3..91d8c58b83355563595d362ad0d25e518272142b 100644 (file)
@@ -40,7 +40,7 @@ DEFINE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats);
 
 /* :.,$s/unsigned long\>.*\<s_\(.*\);/"\1",/g */
 
-static char *rds_stat_names[] = {
+static const char *const rds_stat_names[] = {
        "conn_reset",
        "recv_drop_bad_checksum",
        "recv_drop_old_seq",
@@ -77,7 +77,7 @@ static char *rds_stat_names[] = {
 };
 
 void rds_stats_info_copy(struct rds_info_iterator *iter,
-                        uint64_t *values, char **names, size_t nr)
+                        uint64_t *values, const char *const *names, size_t nr)
 {
        struct rds_info_counter ctr;
        size_t i;
index 3ac1672e1070cc8c4b9a8870dfdb5f894fdcb3e7..c9f1f0a3a2ff4a520e3c7a002115e7e646c2cee4 100644 (file)
@@ -20,7 +20,7 @@
 
 static unsigned rxrpc_ack_defer = 1;
 
-static const char *rxrpc_acks[] = {
+static const char *const rxrpc_acks[] = {
        "---", "REQ", "DUP", "OOS", "WIN", "MEM", "PNG", "PNR", "DLY", "IDL",
        "-?-"
 };
index 7ff548a30cfb63b7a85147faed3292c574ae18ef..bf24fa697de26daf48c4464bb1d90d595cbe9407 100644 (file)
@@ -52,7 +52,7 @@ int sctp_debug_flag = 1;      /* Initially enable DEBUG */
 #endif /* SCTP_DEBUG */
 
 /* These are printable forms of Chunk ID's from section 3.1.  */
-static const char *sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = {
+static const char *const sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = {
        "DATA",
        "INIT",
        "INIT_ACK",
@@ -97,7 +97,7 @@ const char *sctp_cname(const sctp_subtype_t cid)
 }
 
 /* These are printable forms of the states.  */
-const char *sctp_state_tbl[SCTP_STATE_NUM_STATES] = {
+const char *const sctp_state_tbl[SCTP_STATE_NUM_STATES] = {
        "STATE_EMPTY",
        "STATE_CLOSED",
        "STATE_COOKIE_WAIT",
@@ -110,7 +110,7 @@ const char *sctp_state_tbl[SCTP_STATE_NUM_STATES] = {
 };
 
 /* Events that could change the state of an association.  */
-const char *sctp_evttype_tbl[] = {
+const char *const sctp_evttype_tbl[] = {
        "EVENT_T_unknown",
        "EVENT_T_CHUNK",
        "EVENT_T_TIMEOUT",
@@ -119,7 +119,7 @@ const char *sctp_evttype_tbl[] = {
 };
 
 /* Return value of a state function */
-const char *sctp_status_tbl[] = {
+const char *const sctp_status_tbl[] = {
        "DISPOSITION_DISCARD",
        "DISPOSITION_CONSUME",
        "DISPOSITION_NOMEM",
@@ -132,7 +132,7 @@ const char *sctp_status_tbl[] = {
 };
 
 /* Printable forms of primitives */
-static const char *sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = {
+static const char *const sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = {
        "PRIMITIVE_ASSOCIATE",
        "PRIMITIVE_SHUTDOWN",
        "PRIMITIVE_ABORT",
@@ -149,7 +149,7 @@ const char *sctp_pname(const sctp_subtype_t id)
        return "unknown_primitive";
 }
 
-static const char *sctp_other_tbl[] = {
+static const char *const sctp_other_tbl[] = {
        "NO_PENDING_TSN",
        "ICMP_PROTO_UNREACH",
 };
@@ -162,7 +162,7 @@ const char *sctp_oname(const sctp_subtype_t id)
        return "unknown 'other' event";
 }
 
-static const char *sctp_timer_tbl[] = {
+static const char *const sctp_timer_tbl[] = {
        "TIMEOUT_NONE",
        "TIMEOUT_T1_COOKIE",
        "TIMEOUT_T1_INIT",