diff options
author | Antonio Quartulli <antonio@open-mesh.com> | 2013-10-12 20:50:18 -0400 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2013-10-23 11:03:44 -0400 |
commit | 0c69aecc5b1a57d62c39cf8c552a9e823409db60 (patch) | |
tree | 7e4fe1bdec04e8fec9b3b7c802bfa17be0c05782 /net/batman-adv/hard-interface.h | |
parent | 8257f55ae277dd94c015f7cf32f4afd1db59fe8d (diff) |
batman-adv: invoke dev_get_by_index() outside of is_wifi_iface()
Upcoming changes need to perform other checks on the
incoming net_device struct.
To avoid performing dev_get_by_index() for each and every
check, it is better to move it outside of is_wifi_iface()
and search the netdev object once only.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/hard-interface.h')
-rw-r--r-- | net/batman-adv/hard-interface.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/hard-interface.h b/net/batman-adv/hard-interface.h index 49892881a7c5..df4c8bd45c40 100644 --- a/net/batman-adv/hard-interface.h +++ b/net/batman-adv/hard-interface.h | |||
@@ -41,6 +41,7 @@ enum batadv_hard_if_cleanup { | |||
41 | 41 | ||
42 | extern struct notifier_block batadv_hard_if_notifier; | 42 | extern struct notifier_block batadv_hard_if_notifier; |
43 | 43 | ||
44 | bool batadv_is_wifi_netdev(struct net_device *net_device); | ||
44 | struct batadv_hard_iface* | 45 | struct batadv_hard_iface* |
45 | batadv_hardif_get_by_netdev(const struct net_device *net_dev); | 46 | batadv_hardif_get_by_netdev(const struct net_device *net_dev); |
46 | int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, | 47 | int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, |
@@ -51,7 +52,6 @@ void batadv_hardif_remove_interfaces(void); | |||
51 | int batadv_hardif_min_mtu(struct net_device *soft_iface); | 52 | int batadv_hardif_min_mtu(struct net_device *soft_iface); |
52 | void batadv_update_min_mtu(struct net_device *soft_iface); | 53 | void batadv_update_min_mtu(struct net_device *soft_iface); |
53 | void batadv_hardif_free_rcu(struct rcu_head *rcu); | 54 | void batadv_hardif_free_rcu(struct rcu_head *rcu); |
54 | bool batadv_is_wifi_iface(int ifindex); | ||
55 | 55 | ||
56 | static inline void | 56 | static inline void |
57 | batadv_hardif_free_ref(struct batadv_hard_iface *hard_iface) | 57 | batadv_hardif_free_ref(struct batadv_hard_iface *hard_iface) |