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/core | |
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/core')
-rw-r--r-- | net/core/dev.c | 2 | ||||
-rw-r--r-- | net/core/net-sysfs.c | 2 | ||||
-rw-r--r-- | net/core/sock.c | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 71347668c506..f01a9c41f112 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -272,7 +272,7 @@ static const unsigned short netdev_lock_type[] = | |||
272 | ARPHRD_PHONET_PIPE, ARPHRD_IEEE802154, ARPHRD_IEEE802154_PHY, | 272 | ARPHRD_PHONET_PIPE, ARPHRD_IEEE802154, ARPHRD_IEEE802154_PHY, |
273 | ARPHRD_VOID, ARPHRD_NONE}; | 273 | ARPHRD_VOID, ARPHRD_NONE}; |
274 | 274 | ||
275 | static const char *netdev_lock_name[] = | 275 | static const char *const netdev_lock_name[] = |
276 | {"_xmit_NETROM", "_xmit_ETHER", "_xmit_EETHER", "_xmit_AX25", | 276 | {"_xmit_NETROM", "_xmit_ETHER", "_xmit_EETHER", "_xmit_AX25", |
277 | "_xmit_PRONET", "_xmit_CHAOS", "_xmit_IEEE802", "_xmit_ARCNET", | 277 | "_xmit_PRONET", "_xmit_CHAOS", "_xmit_IEEE802", "_xmit_ARCNET", |
278 | "_xmit_APPLETLK", "_xmit_DLCI", "_xmit_ATM", "_xmit_METRICOM", | 278 | "_xmit_APPLETLK", "_xmit_DLCI", "_xmit_ATM", "_xmit_METRICOM", |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 3994680c08b9..ad91e9e5f475 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -141,7 +141,7 @@ static ssize_t show_dormant(struct device *dev, | |||
141 | return -EINVAL; | 141 | return -EINVAL; |
142 | } | 142 | } |
143 | 143 | ||
144 | static const char *operstates[] = { | 144 | static const char *const operstates[] = { |
145 | "unknown", | 145 | "unknown", |
146 | "notpresent", /* currently unused */ | 146 | "notpresent", /* currently unused */ |
147 | "down", | 147 | "down", |
diff --git a/net/core/sock.c b/net/core/sock.c index bbb25be7ddfe..a324a80c163e 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -142,7 +142,7 @@ static struct lock_class_key af_family_slock_keys[AF_MAX]; | |||
142 | * strings build-time, so that runtime initialization of socket | 142 | * strings build-time, so that runtime initialization of socket |
143 | * locks is fast): | 143 | * locks is fast): |
144 | */ | 144 | */ |
145 | static const char *af_family_key_strings[AF_MAX+1] = { | 145 | static const char *const af_family_key_strings[AF_MAX+1] = { |
146 | "sk_lock-AF_UNSPEC", "sk_lock-AF_UNIX" , "sk_lock-AF_INET" , | 146 | "sk_lock-AF_UNSPEC", "sk_lock-AF_UNIX" , "sk_lock-AF_INET" , |
147 | "sk_lock-AF_AX25" , "sk_lock-AF_IPX" , "sk_lock-AF_APPLETALK", | 147 | "sk_lock-AF_AX25" , "sk_lock-AF_IPX" , "sk_lock-AF_APPLETALK", |
148 | "sk_lock-AF_NETROM", "sk_lock-AF_BRIDGE" , "sk_lock-AF_ATMPVC" , | 148 | "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] = { | |||
158 | "sk_lock-AF_IEEE802154", | 158 | "sk_lock-AF_IEEE802154", |
159 | "sk_lock-AF_MAX" | 159 | "sk_lock-AF_MAX" |
160 | }; | 160 | }; |
161 | static const char *af_family_slock_key_strings[AF_MAX+1] = { | 161 | static const char *const af_family_slock_key_strings[AF_MAX+1] = { |
162 | "slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" , | 162 | "slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" , |
163 | "slock-AF_AX25" , "slock-AF_IPX" , "slock-AF_APPLETALK", | 163 | "slock-AF_AX25" , "slock-AF_IPX" , "slock-AF_APPLETALK", |
164 | "slock-AF_NETROM", "slock-AF_BRIDGE" , "slock-AF_ATMPVC" , | 164 | "slock-AF_NETROM", "slock-AF_BRIDGE" , "slock-AF_ATMPVC" , |
@@ -174,7 +174,7 @@ static const char *af_family_slock_key_strings[AF_MAX+1] = { | |||
174 | "slock-AF_IEEE802154", | 174 | "slock-AF_IEEE802154", |
175 | "slock-AF_MAX" | 175 | "slock-AF_MAX" |
176 | }; | 176 | }; |
177 | static const char *af_family_clock_key_strings[AF_MAX+1] = { | 177 | static const char *const af_family_clock_key_strings[AF_MAX+1] = { |
178 | "clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" , | 178 | "clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" , |
179 | "clock-AF_AX25" , "clock-AF_IPX" , "clock-AF_APPLETALK", | 179 | "clock-AF_AX25" , "clock-AF_IPX" , "clock-AF_APPLETALK", |
180 | "clock-AF_NETROM", "clock-AF_BRIDGE" , "clock-AF_ATMPVC" , | 180 | "clock-AF_NETROM", "clock-AF_BRIDGE" , "clock-AF_ATMPVC" , |