Skip to content

Commit

Permalink
Merge branch 'netdev_tx_t'
Browse files Browse the repository at this point in the history
Luc Van Oostenryck says:

====================
net: always use netdev_tx_t for xmit()'s return type

The ndo_start_xmit() methods should return a 'netdev_tx_t', not
an int, and so should return NETDEV_TX_OK, not 0.
The patches in the series fix most of the remaning drivers and
subsystems (those included in allyesconfig on x86).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 29, 2020
2 parents fe80536 + 2a78478 commit d8a6472
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions drivers/net/caif/caif_hsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ static void cfhsi_aggregation_tout(struct timer_list *t)
cfhsi_start_tx(cfhsi);
}

static int cfhsi_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t cfhsi_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct cfhsi *cfhsi = NULL;
int start_xfer = 0;
Expand Down Expand Up @@ -1072,7 +1072,7 @@ static int cfhsi_xmit(struct sk_buff *skb, struct net_device *dev)
spin_unlock_bh(&cfhsi->lock);
if (aggregate_ready)
cfhsi_start_tx(cfhsi);
return 0;
return NETDEV_TX_OK;
}

/* Delete inactivity timer if started. */
Expand Down Expand Up @@ -1102,7 +1102,7 @@ static int cfhsi_xmit(struct sk_buff *skb, struct net_device *dev)
queue_work(cfhsi->wq, &cfhsi->wake_up_work);
}

return 0;
return NETDEV_TX_OK;
}

static const struct net_device_ops cfhsi_netdevops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/caif/caif_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static int handle_tx(struct ser_device *ser)
return tty_wr;
}

static int caif_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t caif_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ser_device *ser;

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/caif/caif_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ static void cfspi_xfer_done_cb(struct cfspi_ifc *ifc)
complete(&cfspi->comp);
}

static int cfspi_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t cfspi_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct cfspi *cfspi = NULL;
unsigned long flags;
Expand All @@ -514,7 +514,7 @@ static int cfspi_xmit(struct sk_buff *skb, struct net_device *dev)
cfspi->cfdev.flowctrl(cfspi->ndev, 0);
}

return 0;
return NETDEV_TX_OK;
}

int cfspi_rxfrm(struct cfspi *cfspi, u8 *buf, size_t len)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/caif/caif_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ static struct buf_info *cfv_alloc_and_copy_to_shm(struct cfv_info *cfv,
}

/* Put the CAIF packet on the virtio ring and kick the receiver */
static int cfv_netdev_tx(struct sk_buff *skb, struct net_device *netdev)
static netdev_tx_t cfv_netdev_tx(struct sk_buff *skb, struct net_device *netdev)
{
struct cfv_info *cfv = netdev_priv(netdev);
struct buf_info *buf_info;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/aquantia/atlantic/aq_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static int aq_ndev_close(struct net_device *ndev)
return err;
}

static int aq_ndev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
static netdev_tx_t aq_ndev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{
struct aq_nic_s *aq_nic = netdev_priv(ndev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/arc/emac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ static struct net_device_stats *arc_emac_stats(struct net_device *ndev)
*
* This function is invoked from upper layers to initiate transmission.
*/
static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)
static netdev_tx_t arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)
{
struct arc_emac_priv *priv = netdev_priv(ndev);
unsigned int len, *txbd_curr = &priv->txbd_curr;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/aurora/nb8800.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static void nb8800_tx_dma_start_irq(struct net_device *dev)
spin_unlock(&priv->tx_lock);
}

static int nb8800_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t nb8800_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct nb8800_priv *priv = netdev_priv(dev);
struct nb8800_tx_desc *txd;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4vf/adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ int t4vf_sge_alloc_eth_txq(struct adapter *, struct sge_eth_txq *,
unsigned int);
void t4vf_free_sge_resources(struct adapter *);

int t4vf_eth_xmit(struct sk_buff *, struct net_device *);
netdev_tx_t t4vf_eth_xmit(struct sk_buff *, struct net_device *);
int t4vf_ethrx_handler(struct sge_rspq *, const __be64 *,
const struct pkt_gl *);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4vf/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ static inline void txq_advance(struct sge_txq *tq, unsigned int n)
*
* Add a packet to an SGE Ethernet TX queue. Runs with softirqs disabled.
*/
int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
{
u32 wr_mid;
u64 cntrl, *end;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/netronome/nfp/nfp_net_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ static int nfp_net_prep_tx_meta(struct sk_buff *skb, u64 tls_handle)
*
* Return: NETDEV_TX_OK on success.
*/
static int nfp_net_tx(struct sk_buff *skb, struct net_device *netdev)
static netdev_tx_t nfp_net_tx(struct sk_buff *skb, struct net_device *netdev)
{
struct nfp_net *nn = netdev_priv(netdev);
const skb_frag_t *frag;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,7 @@ static int pch_gbe_stop(struct net_device *netdev)
* - NETDEV_TX_OK: Normal end
* - NETDEV_TX_BUSY: Error end
*/
static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
static netdev_tx_t pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
{
struct pch_gbe_adapter *adapter = netdev_priv(netdev);
struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ static void xlgmac_tx_timeout(struct net_device *netdev, unsigned int txqueue)
schedule_work(&pdata->restart_work);
}

static int xlgmac_xmit(struct sk_buff *skb, struct net_device *netdev)
static netdev_tx_t xlgmac_xmit(struct sk_buff *skb, struct net_device *netdev)
{
struct xlgmac_pdata *pdata = netdev_priv(netdev);
struct xlgmac_pkt_info *tx_pkt_info;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/plip/plip.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static void plip_timer_bh(struct work_struct *work);
static void plip_interrupt(void *dev_id);

/* Functions for DEV methods */
static int plip_tx_packet(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t plip_tx_packet(struct sk_buff *skb, struct net_device *dev);
static int plip_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned len);
Expand Down Expand Up @@ -958,7 +958,7 @@ plip_interrupt(void *dev_id)
spin_unlock_irqrestore(&nl->lock, flags);
}

static int
static netdev_tx_t
plip_tx_packet(struct sk_buff *skb, struct net_device *dev)
{
struct net_local *nl = netdev_priv(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/ipheth.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ static int ipheth_close(struct net_device *net)
return 0;
}

static int ipheth_tx(struct sk_buff *skb, struct net_device *net)
static netdev_tx_t ipheth_tx(struct sk_buff *skb, struct net_device *net)
{
struct ipheth_device *dev = netdev_priv(net);
struct usb_device *udev = dev->udev;
Expand Down
2 changes: 1 addition & 1 deletion net/hsr/hsr_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static netdev_features_t hsr_fix_features(struct net_device *dev,
return hsr_features_recompute(hsr, features);
}

static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct hsr_priv *hsr = netdev_priv(dev);
struct hsr_port *master;
Expand Down
2 changes: 1 addition & 1 deletion net/l2tp/l2tp_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static void l2tp_eth_dev_uninit(struct net_device *dev)
*/
}

static int l2tp_eth_dev_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t l2tp_eth_dev_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct l2tp_eth *priv = netdev_priv(dev);
struct l2tp_session *session = priv->session;
Expand Down

0 comments on commit d8a6472

Please sign in to comment.