net: xilinx: fix return type of ndo_start_xmit function
authorYueHaibing <yuehaibing@huawei.com>
Wed, 19 Sep 2018 10:32:40 +0000 (18:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:00:15 +0000 (18:00 +0100)
[ Upstream commit 81255af8d9d5565004792c295dde49344df450ca ]

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/xilinx/ll_temac_main.c
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
drivers/net/ethernet/xilinx/xilinx_emaclite.c

index 60abc9250f56a7eac7025447626799e3b046c8f5..2241f98970926f6f64467b0e5fc7994dc07f9ee1 100644 (file)
@@ -674,7 +674,8 @@ static inline int temac_check_tx_bd_space(struct temac_local *lp, int num_frag)
        return 0;
 }
 
-static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+static netdev_tx_t
+temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
        struct temac_local *lp = netdev_priv(ndev);
        struct cdmac_bd *cur_p;
index b481cb174b23eca6fdd745c973a0cad08ddbf91d..9ccd08a051f6a4699fbd9057cf57c6bcf6d40ab7 100644 (file)
@@ -657,7 +657,8 @@ static inline int axienet_check_tx_bd_space(struct axienet_local *lp,
  * start the transmission. Additionally if checksum offloading is supported,
  * it populates AXI Stream Control fields with appropriate values.
  */
-static int axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+static netdev_tx_t
+axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
        u32 ii;
        u32 num_frag;
index 69e31ceccfae4d90a56f6e49312112ec372d1d48..6f3e79159d7a66ddb21985e63669e6f098486029 100644 (file)
@@ -1005,9 +1005,10 @@ static int xemaclite_close(struct net_device *dev)
  * deferred and the Tx queue is stopped so that the deferred socket buffer can
  * be transmitted when the Emaclite device is free to transmit data.
  *
- * Return:     0, always.
+ * Return:     NETDEV_TX_OK, always.
  */
-static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
+static netdev_tx_t
+xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
 {
        struct net_local *lp = netdev_priv(dev);
        struct sk_buff *new_skb;
@@ -1028,7 +1029,7 @@ static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
                /* Take the time stamp now, since we can't do this in an ISR. */
                skb_tx_timestamp(new_skb);
                spin_unlock_irqrestore(&lp->reset_lock, flags);
-               return 0;
+               return NETDEV_TX_OK;
        }
        spin_unlock_irqrestore(&lp->reset_lock, flags);
 
@@ -1037,7 +1038,7 @@ static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
        dev->stats.tx_bytes += len;
        dev_consume_skb_any(new_skb);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /**