提交 b618aaa9 编写于 作者: J Jiri Pirko 提交者: David S. Miller

net: constify netif_is_* helpers net_device param

As suggested by Eric, these helpers should have const dev param.
Suggested-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 abd86a55
...@@ -73,7 +73,7 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) ...@@ -73,7 +73,7 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
/* found in socket.c */ /* found in socket.c */
extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
static inline bool is_vlan_dev(struct net_device *dev) static inline bool is_vlan_dev(const struct net_device *dev)
{ {
return dev->priv_flags & IFF_802_1Q_VLAN; return dev->priv_flags & IFF_802_1Q_VLAN;
} }
......
...@@ -3661,7 +3661,7 @@ extern u8 netdev_rss_key[NETDEV_RSS_KEY_LEN]; ...@@ -3661,7 +3661,7 @@ extern u8 netdev_rss_key[NETDEV_RSS_KEY_LEN];
void netdev_rss_key_fill(void *buffer, size_t len); void netdev_rss_key_fill(void *buffer, size_t len);
int dev_get_nest_level(struct net_device *dev, int dev_get_nest_level(struct net_device *dev,
bool (*type_check)(struct net_device *dev)); bool (*type_check)(const struct net_device *dev));
int skb_checksum_help(struct sk_buff *skb); int skb_checksum_help(struct sk_buff *skb);
struct sk_buff *__skb_gso_segment(struct sk_buff *skb, struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
netdev_features_t features, bool tx_path); netdev_features_t features, bool tx_path);
...@@ -3858,32 +3858,32 @@ static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol, ...@@ -3858,32 +3858,32 @@ static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol,
skb->mac_len = mac_len; skb->mac_len = mac_len;
} }
static inline bool netif_is_macvlan(struct net_device *dev) static inline bool netif_is_macvlan(const struct net_device *dev)
{ {
return dev->priv_flags & IFF_MACVLAN; return dev->priv_flags & IFF_MACVLAN;
} }
static inline bool netif_is_macvlan_port(struct net_device *dev) static inline bool netif_is_macvlan_port(const struct net_device *dev)
{ {
return dev->priv_flags & IFF_MACVLAN_PORT; return dev->priv_flags & IFF_MACVLAN_PORT;
} }
static inline bool netif_is_ipvlan(struct net_device *dev) static inline bool netif_is_ipvlan(const struct net_device *dev)
{ {
return dev->priv_flags & IFF_IPVLAN_SLAVE; return dev->priv_flags & IFF_IPVLAN_SLAVE;
} }
static inline bool netif_is_ipvlan_port(struct net_device *dev) static inline bool netif_is_ipvlan_port(const struct net_device *dev)
{ {
return dev->priv_flags & IFF_IPVLAN_MASTER; return dev->priv_flags & IFF_IPVLAN_MASTER;
} }
static inline bool netif_is_bond_master(struct net_device *dev) static inline bool netif_is_bond_master(const struct net_device *dev)
{ {
return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING; return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING;
} }
static inline bool netif_is_bond_slave(struct net_device *dev) static inline bool netif_is_bond_slave(const struct net_device *dev)
{ {
return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING; return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING;
} }
...@@ -3918,22 +3918,22 @@ static inline bool netif_is_ovs_master(const struct net_device *dev) ...@@ -3918,22 +3918,22 @@ static inline bool netif_is_ovs_master(const struct net_device *dev)
return dev->priv_flags & IFF_OPENVSWITCH; return dev->priv_flags & IFF_OPENVSWITCH;
} }
static inline bool netif_is_team_master(struct net_device *dev) static inline bool netif_is_team_master(const struct net_device *dev)
{ {
return dev->priv_flags & IFF_TEAM; return dev->priv_flags & IFF_TEAM;
} }
static inline bool netif_is_team_port(struct net_device *dev) static inline bool netif_is_team_port(const struct net_device *dev)
{ {
return dev->priv_flags & IFF_TEAM_PORT; return dev->priv_flags & IFF_TEAM_PORT;
} }
static inline bool netif_is_lag_master(struct net_device *dev) static inline bool netif_is_lag_master(const struct net_device *dev)
{ {
return netif_is_bond_master(dev) || netif_is_team_master(dev); return netif_is_bond_master(dev) || netif_is_team_master(dev);
} }
static inline bool netif_is_lag_port(struct net_device *dev) static inline bool netif_is_lag_port(const struct net_device *dev)
{ {
return netif_is_bond_slave(dev) || netif_is_team_port(dev); return netif_is_bond_slave(dev) || netif_is_team_port(dev);
} }
......
...@@ -5734,7 +5734,7 @@ EXPORT_SYMBOL(netdev_lower_dev_get_private); ...@@ -5734,7 +5734,7 @@ EXPORT_SYMBOL(netdev_lower_dev_get_private);
int dev_get_nest_level(struct net_device *dev, int dev_get_nest_level(struct net_device *dev,
bool (*type_check)(struct net_device *dev)) bool (*type_check)(const struct net_device *dev))
{ {
struct net_device *lower = NULL; struct net_device *lower = NULL;
struct list_head *iter; struct list_head *iter;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册