Skip to contentSkip to conversation

net: dsa: Remove redundant NULL dst check

PATCH Applied Florian Fainelli 3 participants 3 messages Apr 20, 2017 – Apr 21, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: Remove redundant NULL dst check

tag_lan9303.c does check for a NULL dst but that's already checked by dsa_switch_rcv() one layer above.

---
 net/dsa/tag_lan9303.c | 5 -----
 1 file changed, 5 deletions(-)
net/dsa/tag_lan9303.c +0 -5
index 563b6c8fe445..70130ed5c21a 100644
@@ -79,11 +79,6 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
 	struct dsa_switch *ds;
 	unsigned int source_port;
 
-	if (unlikely(!dst)) {
-		dev_warn_ratelimited(&dev->dev, "Dropping packet, due to missing switch tree device\n");
-		return NULL;
-	}
-
 	ds = dst->ds[0];
 
 	if (unlikely(!ds)) {
Signature · 1 line
2.9.3
Acked-by on v1 1/1
#1 lore raw

Hi Florian,

Quoted 14 lines · On Friday 21 April 2017 00:47:22 Florian Fainelli wrote:

tag_lan9303.c does check for a NULL dst but that's already checked by dsa_switch_rcv() one layer above.

---
 net/dsa/tag_lan9303.c | 5 -----
 1 file changed, 5 deletions(-)
net/dsa/tag_lan9303.c +0 -0
index 563b6c8fe445..70130ed5c21a 100644
@@ -79,11 +79,6 @@ static struct sk_buff *lan9303_rcv(struct sk_buff
 *skb, struct net_device *dev, struct dsa_switch *ds;

net/dsa/tag_lan9303.c static struct sk_buff *lan9303_rcv(struct sk_buff · line 84

Quoted 10 lines
net/dsa/tag_lan9303.c +0 -5
 	unsigned int source_port;
 
-	if (unlikely(!dst)) {
-		dev_warn_ratelimited(&dev->dev, "Dropping packet, due to missing switch tree device\n");
-		return NULL; 
-	}
-
 	ds = dst->ds[0];
 
 	if (unlikely(!ds)) {

Thanks!

Signature · 2 lines
Pengutronix e.K.                             | Juergen Borleis             |
Industrial Linux Solutions                   | http://www.pengutronix.de/  |