Skip to contentSkip to conversation

staging/wilc1000: let wilc_mac_xmit() to NETDEV_TX_OK

PATCH In review Luc Van Oostenryck 3 participants 5 messages Jun 28, 2020 – Jul 14, 2020

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

PATCH 1/1 staging/wilc1000: let wilc_mac_xmit() to NETDEV_TX_OK

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type defining 'NETDEV_TX_OK' but this driver returns '0' instead of 'NETDEV_TX_OK'.

Fix this by returning ''NETDEV_TX_OK' instead of 0.

---
 drivers/staging/wilc1000/netdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/netdev.c +3 -3
index fda0ab97b02c..be3ae5486f44 100644
@@ -678,14 +678,14 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 
 	if (skb->dev != ndev) {
 		netdev_err(ndev, "Packet not destined to this device\n");
-		return 0;
+		return NETDEV_TX_OK;
 	}
 
 	tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC);
 	if (!tx_data) {
 		dev_kfree_skb(skb);
 		netif_wake_queue(ndev);
-		return 0;
+		return NETDEV_TX_OK;
 	}
 
 	tx_data->buff = skb->data;
@@ -710,7 +710,7 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 		srcu_read_unlock(&wilc->srcu, srcu_idx);
 	}
 
-	return 0;
+	return NETDEV_TX_OK;
 }
 
 static int wilc_mac_close(struct net_device *ndev)
Signature · 1 line
2.27.0
#1 lore raw

Luc,

Thanks for your patch...

Quoted 9 lines · Luc Van Oostenryck

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type defining 'NETDEV_TX_OK' but this driver returns '0' instead of 'NETDEV_TX_OK'.

Fix this by returning ''NETDEV_TX_OK' instead of 0.

---
  drivers/staging/wilc1000/netdev.c | 6 +++---

... would it be possible that you re-spin it so that it applies to the new location of this driver:
drivers/net/wireless/microchip/wilc1000/netdev.c

You can rebase your patch on the wireless-driver-next tree with wilc1000-move-out-of-staging branch:

tree:
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
branch: wilc1000-move-out-of-staging

(Then you can also review the subject line of your patch, BTW)

Thanks for your help. Best regards,
Nicolas

Quoted 35 lines
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/netdev.c +3 -4
index fda0ab97b02c..be3ae5486f44 100644
@@ -678,14 +678,14 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 
         if (skb->dev != ndev) {
                 netdev_err(ndev, "Packet not destined to this device\n");
-               return 0;
+               return NETDEV_TX_OK;
         }
 
         tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC);
         if (!tx_data) {
                 dev_kfree_skb(skb);
                 netif_wake_queue(ndev);
-               return 0;
+               return NETDEV_TX_OK;
         }
 
         tx_data->buff = skb->data;
@@ -710,7 +710,7 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
                 srcu_read_unlock(&wilc->srcu, srcu_idx);
         }
 
-       return 0;
+       return NETDEV_TX_OK;
  }
 
  static int wilc_mac_close(struct net_device *ndev)
--

2.27.0

Signature · 1 line
Nicolas Ferre
#2 lore raw

PATCH 1/1 wilc1000: let wilc_mac_xmit() return NETDEV_TX_OK

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type defining 'NETDEV_TX_OK' but this driver returns '0' instead of 'NETDEV_TX_OK'.

Fix this by returning 'NETDEV_TX_OK' instead of '0'.

---
 drivers/net/wireless/microchip/wilc1000/netdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/microchip/wilc1000/netdev.c +3 -3
index fda0ab97b02c..be3ae5486f44 100644
@@ -678,14 +678,14 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 
 	if (skb->dev != ndev) {
 		netdev_err(ndev, "Packet not destined to this device\n");
-		return 0;
+		return NETDEV_TX_OK;
 	}
 
 	tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC);
 	if (!tx_data) {
 		dev_kfree_skb(skb);
 		netif_wake_queue(ndev);
-		return 0;
+		return NETDEV_TX_OK;
 	}
 
 	tx_data->buff = skb->data;
@@ -710,7 +710,7 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 		srcu_read_unlock(&wilc->srcu, srcu_idx);
 	}
 
-	return 0;
+	return NETDEV_TX_OK;
 }
 
 static int wilc_mac_close(struct net_device *ndev)
Signature · 1 line
2.27.0
#3 lore raw

Re: [PATCH] wilc1000: let wilc_mac_xmit() return NETDEV_TX_OK

Quoted 7 lines · Luc Van Oostenryck

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type defining 'NETDEV_TX_OK' but this driver returns '0' instead of 'NETDEV_TX_OK'.

Fix this by returning 'NETDEV_TX_OK' instead of '0'.

Patch applied to wireless-drivers-next.git, thanks.

cce0e08301fe wilc1000: let wilc_mac_xmit() return NETDEV_TX_OK

Signature · 3 lines
https://patchwork.kernel.org/patch/11632291/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#4 lore raw
In reply to [email protected]
Quoted 19 lines · <[email protected]> writes:

Luc,

Thanks for your patch...

Quoted 9 lines · Luc Van Oostenryck

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type defining 'NETDEV_TX_OK' but this driver returns '0' instead of 'NETDEV_TX_OK'.

Fix this by returning ''NETDEV_TX_OK' instead of 0.

---
  drivers/staging/wilc1000/netdev.c | 6 +++---

... would it be possible that you re-spin it so that it applies to the new location of this driver:
drivers/net/wireless/microchip/wilc1000/netdev.c

Quoted 8 lines

You can rebase your patch on the wireless-driver-next tree with wilc1000-move-out-of-staging branch:

tree:
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
branch: wilc1000-move-out-of-staging

(Then you can also review the subject line of your patch, BTW)

And also cc linux-wireless so that our patchwork sees it (not sure if the original patch had it or not, just making sure), more info in the link below.

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches