net: toshiba: fix return type of ndo_start_xmit function
authorYueHaibing <yuehaibing@huawei.com>
Wed, 19 Sep 2018 10:23:39 +0000 (18:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2019 08:52:34 +0000 (09:52 +0100)
[ Upstream commit bacade822524e02f662d88f784d2ae821a5546fb ]

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, so make sure the implementation in
this driver has returns 'netdev_tx_t' value, and change the function
return type to netdev_tx_t.

Found by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/toshiba/ps3_gelic_net.c
drivers/net/ethernet/toshiba/ps3_gelic_net.h
drivers/net/ethernet/toshiba/spider_net.c
drivers/net/ethernet/toshiba/tc35815.c

index 272f2b1cb7add6bf95da8e9c25794aaf0404d6f1..34f84379553109ef9fed37204c0444e8b2612db1 100644 (file)
@@ -845,9 +845,9 @@ static int gelic_card_kick_txdma(struct gelic_card *card,
  * @skb: packet to send out
  * @netdev: interface device structure
  *
- * returns 0 on success, <0 on failure
+ * returns NETDEV_TX_OK on success, NETDEV_TX_BUSY on failure
  */
-int gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
+netdev_tx_t gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
 {
        struct gelic_card *card = netdev_card(netdev);
        struct gelic_descr *descr;
index 8505196be9f52bd7a982ec9dcb91f850379cfd07..d123644bd720b0604454c68328ff81d94da74c5c 100644 (file)
@@ -370,7 +370,7 @@ void gelic_card_up(struct gelic_card *card);
 void gelic_card_down(struct gelic_card *card);
 int gelic_net_open(struct net_device *netdev);
 int gelic_net_stop(struct net_device *netdev);
-int gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev);
+netdev_tx_t gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev);
 void gelic_net_set_multi(struct net_device *netdev);
 void gelic_net_tx_timeout(struct net_device *netdev);
 int gelic_net_change_mtu(struct net_device *netdev, int new_mtu);
index 36a6e8b54d9415d65bf1b6d2804a53949372eaa6..1085987946212fdc4406c6dbb0fd7b0bec37cfe5 100644 (file)
@@ -880,9 +880,9 @@ out:
  * @skb: packet to send out
  * @netdev: interface device structure
  *
- * returns 0 on success, !0 on failure
+ * returns NETDEV_TX_OK on success, NETDEV_TX_BUSY on failure
  */
-static int
+static netdev_tx_t
 spider_net_xmit(struct sk_buff *skb, struct net_device *netdev)
 {
        int cnt;
index 47ebac456ae57e1ef47a84b3dd7138a974bd0e90..9b84ee736fdc11c31ce9d29772c5f7c2390d40c1 100644 (file)
@@ -474,7 +474,8 @@ static void free_rxbuf_skb(struct pci_dev *hwdev, struct sk_buff *skb, dma_addr_
 /* Index to functions, as function prototypes. */
 
 static int     tc35815_open(struct net_device *dev);
-static int     tc35815_send_packet(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t     tc35815_send_packet(struct sk_buff *skb,
+                                           struct net_device *dev);
 static irqreturn_t     tc35815_interrupt(int irq, void *dev_id);
 static int     tc35815_rx(struct net_device *dev, int limit);
 static int     tc35815_poll(struct napi_struct *napi, int budget);
@@ -1249,7 +1250,8 @@ tc35815_open(struct net_device *dev)
  * invariant will hold if you make sure that the netif_*_queue()
  * calls are done at the proper times.
  */
-static int tc35815_send_packet(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t
+tc35815_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
        struct tc35815_local *lp = netdev_priv(dev);
        struct TxFD *txfd;