drivers/net/wan/x25_asy: Remove an unnecessary x25_type_trans call
Subsystems (2)
PATCH 1/1 drivers/net/wan/x25_asy: Remove an unnecessary x25_type_trans call
x25_type_trans only needs to be called before we call netif_rx to pass the skb to upper layers.
It does not need to be called before lapb_data_received. The LAPB module does not need the fields that are set by calling it.
In the other two X.25 drivers - lapbether and hdlc_x25. x25_type_trans is only called before netif_rx and not before lapb_data_received.
--- drivers/net/wan/x25_asy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wan/x25_asy.c +1 -2
@@ -202,8 +202,7 @@ static void x25_asy_bump(struct x25_asy *sl)return ; }skb_put_data (skb, sl->rbuff, count); - skb->protocol =x25_type_trans (skb, sl->dev); - err =lapb_data_received (skb->dev, skb); + err =lapb_data_received (sl->dev, skb);if (err !=LAPB_OK ) {kfree_skb (skb);printk (KERN_DEBUG "x25_asy: data received err - %d\n" , err);
Signature · 1 line
2.25.1
Quoted 20 lines · Xie He
x25_type_transonly needs to be called before we callnetif_rxto pass the skb to upper layers.It does not need to be called before
lapb_data_received. The LAPB module does not need the fields that are set by calling it.In the other two X.25 drivers - lapbether and
hdlc_x25.x25_type_transis only called beforenetif_rxand not beforelapb_data_received.Cc Martin Schiller <[email protected]>Signed-off-by Xie He <[email protected]>--- drivers/net/wan/x25_asy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/net/wan/x25_asy.c +0
-0
drivers/net/wan/x25_asy.c static void x25_asy_bump(struct x25_asy *sl) · line 208
Quoted 9 lines
drivers/net/wan/x25_asy.c +1
-2@@ -202,8 +202,7 @@ static void x25_asy_bump(struct x25_asy *sl)return ; }skb_put_data (skb, sl->rbuff, count); - skb->protocol =x25_type_trans (skb, sl->dev); - err =lapb_data_received (skb->dev, skb); + err =lapb_data_received (sl->dev, skb);if (err !=LAPB_OK ) {kfree_skb (skb);printk (KERN_DEBUG "x25_asy: data received err - %d\n" , err);
Quoted 2 lines · Martin Schiller
Acked-by Martin Schiller <[email protected]>
Thank you, Martin!
From: Xie He <[email protected]>
Date: Fri, 11 Sep 2020 19:18:07 -0700
Quoted 11 lines
x25_type_transonly needs to be called before we callnetif_rxto pass the skb to upper layers.It does not need to be called before
lapb_data_received. The LAPB module does not need the fields that are set by calling it.In the other two X.25 drivers - lapbether and
hdlc_x25.x25_type_transis only called beforenetif_rxand not beforelapb_data_received.Cc Martin Schiller <[email protected]>Signed-off-by Xie He <[email protected]>
Applied to net-next, thanks.