diff options
author | Sven Eckelmann <sven@narfation.org> | 2011-05-14 17:14:50 -0400 |
---|---|---|
committer | Sven Eckelmann <sven@narfation.org> | 2011-05-30 01:39:31 -0400 |
commit | 747e4221a03cde62402b614ca1f8e961b8416130 (patch) | |
tree | 98428064fef191a5093e276d5a779b9e801a97f0 /net/batman-adv/hard-interface.c | |
parent | 38e3c5f0dae7a3bbb32c3b2bb28c3f2557d40fe9 (diff) |
batman-adv: Add const type qualifier for pointers
batman-adv uses pointers which are marked as const and should not
violate that type qualifier by passing it to functions which force a
cast to the non-const version.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/hard-interface.c')
-rw-r--r-- | net/batman-adv/hard-interface.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index dfbfccc9fe40..915e12b820b9 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -46,7 +46,7 @@ void hardif_free_rcu(struct rcu_head *rcu) | |||
46 | kfree(hard_iface); | 46 | kfree(hard_iface); |
47 | } | 47 | } |
48 | 48 | ||
49 | struct hard_iface *hardif_get_by_netdev(struct net_device *net_dev) | 49 | struct hard_iface *hardif_get_by_netdev(const struct net_device *net_dev) |
50 | { | 50 | { |
51 | struct hard_iface *hard_iface; | 51 | struct hard_iface *hard_iface; |
52 | 52 | ||
@@ -64,7 +64,7 @@ out: | |||
64 | return hard_iface; | 64 | return hard_iface; |
65 | } | 65 | } |
66 | 66 | ||
67 | static int is_valid_iface(struct net_device *net_dev) | 67 | static int is_valid_iface(const struct net_device *net_dev) |
68 | { | 68 | { |
69 | if (net_dev->flags & IFF_LOOPBACK) | 69 | if (net_dev->flags & IFF_LOOPBACK) |
70 | return 0; | 70 | return 0; |
@@ -86,7 +86,7 @@ static int is_valid_iface(struct net_device *net_dev) | |||
86 | return 1; | 86 | return 1; |
87 | } | 87 | } |
88 | 88 | ||
89 | static struct hard_iface *hardif_get_active(struct net_device *soft_iface) | 89 | static struct hard_iface *hardif_get_active(const struct net_device *soft_iface) |
90 | { | 90 | { |
91 | struct hard_iface *hard_iface; | 91 | struct hard_iface *hard_iface; |
92 | 92 | ||
@@ -160,7 +160,7 @@ static void primary_if_select(struct bat_priv *bat_priv, | |||
160 | atomic_set(&bat_priv->tt_local_changed, 1); | 160 | atomic_set(&bat_priv->tt_local_changed, 1); |
161 | } | 161 | } |
162 | 162 | ||
163 | static bool hardif_is_iface_up(struct hard_iface *hard_iface) | 163 | static bool hardif_is_iface_up(const struct hard_iface *hard_iface) |
164 | { | 164 | { |
165 | if (hard_iface->net_dev->flags & IFF_UP) | 165 | if (hard_iface->net_dev->flags & IFF_UP) |
166 | return true; | 166 | return true; |
@@ -176,9 +176,9 @@ static void update_mac_addresses(struct hard_iface *hard_iface) | |||
176 | hard_iface->net_dev->dev_addr, ETH_ALEN); | 176 | hard_iface->net_dev->dev_addr, ETH_ALEN); |
177 | } | 177 | } |
178 | 178 | ||
179 | static void check_known_mac_addr(struct net_device *net_dev) | 179 | static void check_known_mac_addr(const struct net_device *net_dev) |
180 | { | 180 | { |
181 | struct hard_iface *hard_iface; | 181 | const struct hard_iface *hard_iface; |
182 | 182 | ||
183 | rcu_read_lock(); | 183 | rcu_read_lock(); |
184 | list_for_each_entry_rcu(hard_iface, &hardif_list, list) { | 184 | list_for_each_entry_rcu(hard_iface, &hardif_list, list) { |
@@ -204,8 +204,8 @@ static void check_known_mac_addr(struct net_device *net_dev) | |||
204 | 204 | ||
205 | int hardif_min_mtu(struct net_device *soft_iface) | 205 | int hardif_min_mtu(struct net_device *soft_iface) |
206 | { | 206 | { |
207 | struct bat_priv *bat_priv = netdev_priv(soft_iface); | 207 | const struct bat_priv *bat_priv = netdev_priv(soft_iface); |
208 | struct hard_iface *hard_iface; | 208 | const struct hard_iface *hard_iface; |
209 | /* allow big frames if all devices are capable to do so | 209 | /* allow big frames if all devices are capable to do so |
210 | * (have MTU > 1500 + BAT_HEADER_LEN) */ | 210 | * (have MTU > 1500 + BAT_HEADER_LEN) */ |
211 | int min_mtu = ETH_DATA_LEN; | 211 | int min_mtu = ETH_DATA_LEN; |
@@ -285,7 +285,8 @@ static void hardif_deactivate_interface(struct hard_iface *hard_iface) | |||
285 | update_min_mtu(hard_iface->soft_iface); | 285 | update_min_mtu(hard_iface->soft_iface); |
286 | } | 286 | } |
287 | 287 | ||
288 | int hardif_enable_interface(struct hard_iface *hard_iface, char *iface_name) | 288 | int hardif_enable_interface(struct hard_iface *hard_iface, |
289 | const char *iface_name) | ||
289 | { | 290 | { |
290 | struct bat_priv *bat_priv; | 291 | struct bat_priv *bat_priv; |
291 | struct batman_packet *batman_packet; | 292 | struct batman_packet *batman_packet; |