linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: YueHaibing <yuehaibing@huawei.com>
Cc: 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,
	dev@openvswitch.org, linux-mips@linux-mips.org,
	xen-devel@lists.xenproject.org, netdev@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-can@vger.kernel.org, devel@linuxdriverproject.org,
	linux-hams@vger.kernel.org, linux-omap@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
Subject: [net-next,17/22] hv_netvsc: fix return type of ndo_start_xmit function
Date: Thu, 20 Sep 2018 07:43:41 -0700	[thread overview]
Message-ID: <20180920074341.3acef75c@xeon-e3> (raw)

On Thu, 20 Sep 2018 20:33:01 +0800
YueHaibing <yuehaibing@huawei.com> wrote:

> 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/hyperv/netvsc_drv.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
> index 3af6d8d..056c472 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -511,7 +511,8 @@ static int netvsc_vf_xmit(struct net_device *net, struct net_device *vf_netdev,
>  	return rc;
>  }
>  
> -static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
> +static netdev_tx_t
> +netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
>  {
>  	struct net_device_context *net_device_ctx = netdev_priv(net);
>  	struct hv_netvsc_packet *packet = NULL;
> @@ -528,8 +529,11 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
>  	 */
>  	vf_netdev = rcu_dereference_bh(net_device_ctx->vf_netdev);
>  	if (vf_netdev && netif_running(vf_netdev) &&
> -	    !netpoll_tx_running(net))
> -		return netvsc_vf_xmit(net, vf_netdev, skb);
> +	    !netpoll_tx_running(net)) {
> +		ret = netvsc_vf_xmit(net, vf_netdev, skb);
> +		if (ret)
> +			return NETDEV_TX_BUSY;
> +	}

Sorry, the new code is wrong. It will fall through if ret == 0 (NETDEV_TX_OK)
Please review and test your patches.

             reply	other threads:[~2018-09-20 14:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 14:43 Stephen Hemminger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-21  1:37 [net-next,17/22] hv_netvsc: fix return type of ndo_start_xmit function YueHaibing
2018-09-20 14:40 Haiyang Zhang
2018-09-20 12:33 YueHaibing

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=20180920074341.3acef75c@xeon-e3 \
    --to=stephen@networkplumber.org \
    --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 \
    --cc=yuehaibing@huawei.com \
    /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).