netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: <davem@davemloft.net>, <dmitry.tarnyagin@lockless.no>,
	<wg@grandegger.com>, <mkl@pengutronix.de>,
	<michal.simek@xilinx.com>, <hsweeten@visionengravers.com>,
	<madalin.bucur@nxp.com>, <pantelis.antoniou@gmail.com>,
	<claudiu.manoil@nxp.com>, <leoyang.li@nxp.com>,
	<linux@armlinux.org.uk>, <sammy@sammy.net>, <ralf@linux-mips.org>,
	<nico@fluxnic.net>, <steve.glendinning@shawell.net>,
	<f.fainelli@gmail.com>, <grygorii.strashko@ti.com>,
	<w-kwok2@ti.com>, <m-karicheri2@ti.com>,
	<t.sailer@alumni.ethz.ch>, <jreuter@yaina.de>,
	<kys@microsoft.com>, <haiyangz@microsoft.com>,
	<wei.liu2@citrix.com>, <paul.durrant@citrix.com>,
	<arvid.brodin@alten.se>, <pshelar@ovn.org>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-can@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linuxppc-dev@lists.ozlabs.org>, <linux-mips@linux-mips.org>,
	<linux-omap@vger.kernel.org>, <linux-hams@vger.kernel.org>,
	<devel@linuxdriverproject.org>, <linux-usb@vger.kernel.org>,
	<xen-devel@lists.xenproject.org>, <dev@openvswitch.org>,
	YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH net-next 14/22] net: caif: fix return type of ndo_start_xmit function
Date: Thu, 20 Sep 2018 20:32:58 +0800	[thread overview]
Message-ID: <20180920123306.14772-15-yuehaibing@huawei.com> (raw)
In-Reply-To: <20180920123306.14772-1-yuehaibing@huawei.com>

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>
---
 drivers/net/caif/caif_hsi.c    | 10 +++++-----
 drivers/net/caif/caif_serial.c |  7 +++++--
 drivers/net/caif/caif_spi.c    |  6 +++---
 drivers/net/caif/caif_virtio.c |  2 +-
 net/caif/chnl_net.c            |  3 ++-
 5 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 433a14b..70c449e 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -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;
@@ -1014,7 +1014,7 @@ static int cfhsi_xmit(struct sk_buff *skb, struct net_device *dev)
 	int prio;
 
 	if (!dev)
-		return -EINVAL;
+		return NETDEV_TX_BUSY;
 
 	cfhsi = netdev_priv(dev);
 
@@ -1048,7 +1048,7 @@ static int cfhsi_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (WARN_ON(test_bit(CFHSI_SHUTDOWN, &cfhsi->bits))) {
 		spin_unlock_bh(&cfhsi->lock);
 		cfhsi_abort_tx(cfhsi);
-		return -EINVAL;
+		return NETDEV_TX_BUSY;
 	}
 
 	/* Send flow off if number of packets is above high water mark. */
@@ -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. */
@@ -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;
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
index a0f954f..acb3264 100644
--- a/drivers/net/caif/caif_serial.c
+++ b/drivers/net/caif/caif_serial.c
@@ -275,7 +275,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;
 
@@ -290,7 +290,10 @@ static int caif_xmit(struct sk_buff *skb, struct net_device *dev)
 		ser->common.flowctrl(ser->dev, OFF);
 
 	skb_queue_tail(&ser->head, skb);
-	return handle_tx(ser);
+	if (handle_tx(ser))
+		return NETDEV_TX_BUSY;
+
+	return NETDEV_TX_OK;
 }
 
 
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index d28a139..9040658 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -486,12 +486,12 @@ 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;
 	if (!dev)
-		return -EINVAL;
+		return NETDEV_TX_BUSY;
 
 	cfspi = netdev_priv(dev);
 
@@ -512,7 +512,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)
diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c
index 2814e0d..f5507db 100644
--- a/drivers/net/caif/caif_virtio.c
+++ b/drivers/net/caif/caif_virtio.c
@@ -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;
diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c
index 13e2ae6..30be426 100644
--- a/net/caif/chnl_net.c
+++ b/net/caif/chnl_net.c
@@ -211,7 +211,8 @@ static void chnl_flowctrl_cb(struct cflayer *layr, enum caif_ctrlcmd flow,
 	}
 }
 
-static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t
+chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct chnl_net *priv;
 	struct cfpkt *pkt = NULL;
-- 
1.8.3.1

  parent reply	other threads:[~2018-09-20 12:32 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 12:32 [PATCH net-next 00/22] net: fix return type of ndo_start_xmit function YueHaibing
2018-09-20 12:32 ` [PATCH net-next 01/22] net: micrel: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 02/22] net: freescale: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 03/22] net: seeq: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 04/22] net: cirrus: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 05/22] net: sgi: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 06/22] net: wiznet: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 07/22] net: i825xx: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 08/22] net: apple: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 09/22] net: smsc: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 10/22] net: ti: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 11/22] net: faraday: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 12/22] net: ovs: " YueHaibing
2018-09-20 12:32 ` [PATCH net-next 13/22] net: xen-netback: " YueHaibing
2018-09-20 14:05   ` Wei Liu
2018-09-20 12:32 ` YueHaibing [this message]
2018-09-20 12:32 ` [PATCH net-next 15/22] net: hamradio: " YueHaibing
2018-09-20 12:33 ` [PATCH net-next 16/22] usbnet: ipheth: " YueHaibing
2018-09-20 12:33 ` [PATCH net-next 17/22] hv_netvsc: " YueHaibing
2018-09-20 14:40   ` Haiyang Zhang
2018-09-20 14:43   ` Stephen Hemminger
2018-09-20 14:50     ` Haiyang Zhang via dev
2018-09-21  1:35       ` YueHaibing
2018-09-21  1:37     ` YueHaibing
2018-09-20 12:33 ` [PATCH net-next 18/22] can: xilinx: " YueHaibing
2018-09-20 12:33 ` [PATCH net-next 19/22] net: plip: " YueHaibing
2018-09-20 12:33 ` [PATCH net-next 20/22] rionet: " YueHaibing
2018-09-20 12:33 ` [PATCH net-next 21/22] l2tp: " YueHaibing
2018-09-20 12:33 ` [PATCH net-next 22/22] net: hsr: " YueHaibing
2018-09-20 15:50 ` [PATCH net-next 00/22] net: " David Miller
2018-09-21  1:33   ` YueHaibing
2018-09-20 17:04 ` Grygorii Strashko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180920123306.14772-15-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=arvid.brodin@alten.se \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=devel@linuxdriverproject.org \
    --cc=dmitry.tarnyagin@lockless.no \
    --cc=f.fainelli@gmail.com \
    --cc=grygorii.strashko@ti.com \
    --cc=haiyangz@microsoft.com \
    --cc=hsweeten@visionengravers.com \
    --cc=jreuter@yaina.de \
    --cc=kys@microsoft.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-hams@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=m-karicheri2@ti.com \
    --cc=madalin.bucur@nxp.com \
    --cc=michal.simek@xilinx.com \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=nico@fluxnic.net \
    --cc=pantelis.antoniou@gmail.com \
    --cc=paul.durrant@citrix.com \
    --cc=pshelar@ovn.org \
    --cc=ralf@linux-mips.org \
    --cc=sammy@sammy.net \
    --cc=steve.glendinning@shawell.net \
    --cc=t.sailer@alumni.ethz.ch \
    --cc=w-kwok2@ti.com \
    --cc=wei.liu2@citrix.com \
    --cc=wg@grandegger.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).