mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 20:54:10 +08:00
net: dsa: rename dsa_master_get_slave
The dsa_master_get_slave is slightly confusing since the idiomatic "get" term often suggests reference counting, in symmetry to "put". Rename it to dsa_master_find_slave to make the look up operation clear. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d0006b0022
commit
2231c43b56
@ -113,8 +113,8 @@ int dsa_legacy_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
|
||||
int dsa_master_ethtool_setup(struct net_device *dev);
|
||||
void dsa_master_ethtool_restore(struct net_device *dev);
|
||||
|
||||
static inline struct net_device *dsa_master_get_slave(struct net_device *dev,
|
||||
int device, int port)
|
||||
static inline struct net_device *dsa_master_find_slave(struct net_device *dev,
|
||||
int device, int port)
|
||||
{
|
||||
struct dsa_port *cpu_dp = dev->dsa_ptr;
|
||||
struct dsa_switch_tree *dst = cpu_dp->dst;
|
||||
|
@ -119,7 +119,7 @@ static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
/* Locate which port this is coming from */
|
||||
source_port = brcm_tag[3] & BRCM_EG_PID_MASK;
|
||||
|
||||
skb->dev = dsa_master_get_slave(dev, 0, source_port);
|
||||
skb->dev = dsa_master_find_slave(dev, 0, source_port);
|
||||
if (!skb->dev)
|
||||
return NULL;
|
||||
|
||||
|
@ -91,7 +91,7 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
source_device = dsa_header[0] & 0x1f;
|
||||
source_port = (dsa_header[1] >> 3) & 0x1f;
|
||||
|
||||
skb->dev = dsa_master_get_slave(dev, source_device, source_port);
|
||||
skb->dev = dsa_master_find_slave(dev, source_device, source_port);
|
||||
if (!skb->dev)
|
||||
return NULL;
|
||||
|
||||
|
@ -104,7 +104,7 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
source_device = edsa_header[0] & 0x1f;
|
||||
source_port = (edsa_header[1] >> 3) & 0x1f;
|
||||
|
||||
skb->dev = dsa_master_get_slave(dev, source_device, source_port);
|
||||
skb->dev = dsa_master_find_slave(dev, source_device, source_port);
|
||||
if (!skb->dev)
|
||||
return NULL;
|
||||
|
||||
|
@ -87,7 +87,7 @@ static struct sk_buff *ksz_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
|
||||
source_port = tag[0] & 7;
|
||||
|
||||
skb->dev = dsa_master_get_slave(dev, 0, source_port);
|
||||
skb->dev = dsa_master_find_slave(dev, 0, source_port);
|
||||
if (!skb->dev)
|
||||
return NULL;
|
||||
|
||||
|
@ -94,7 +94,7 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
|
||||
source_port = ntohs(lan9303_tag[1]) & 0x3;
|
||||
|
||||
skb->dev = dsa_master_get_slave(dev, 0, source_port);
|
||||
skb->dev = dsa_master_find_slave(dev, 0, source_port);
|
||||
if (!skb->dev) {
|
||||
dev_warn_ratelimited(&dev->dev, "Dropping packet due to invalid source port\n");
|
||||
return NULL;
|
||||
|
@ -69,7 +69,7 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
/* Get source port information */
|
||||
port = (hdr & MTK_HDR_RECV_SOURCE_PORT_MASK);
|
||||
|
||||
skb->dev = dsa_master_get_slave(dev, 0, port);
|
||||
skb->dev = dsa_master_find_slave(dev, 0, port);
|
||||
if (!skb->dev)
|
||||
return NULL;
|
||||
|
||||
|
@ -91,7 +91,7 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
/* Get source port information */
|
||||
port = (hdr & QCA_HDR_RECV_SOURCE_PORT_MASK);
|
||||
|
||||
skb->dev = dsa_master_get_slave(dev, 0, port);
|
||||
skb->dev = dsa_master_find_slave(dev, 0, port);
|
||||
if (!skb->dev)
|
||||
return NULL;
|
||||
|
||||
|
@ -71,7 +71,7 @@ static struct sk_buff *trailer_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
|
||||
source_port = trailer[1] & 7;
|
||||
|
||||
skb->dev = dsa_master_get_slave(dev, 0, source_port);
|
||||
skb->dev = dsa_master_find_slave(dev, 0, source_port);
|
||||
if (!skb->dev)
|
||||
return NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user