Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1963039imm; Thu, 20 Sep 2018 05:49:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbzbhxUUdP7Q2bxuH8BqCT9DxxraWmmUDlPtCGy+zioMKqq7YZbKAEHXg8ILOpW7oUMrAEx X-Received: by 2002:a62:6cc6:: with SMTP id h189-v6mr3428954pfc.23.1537447747914; Thu, 20 Sep 2018 05:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537447747; cv=none; d=google.com; s=arc-20160816; b=E9gnFkZTdH950985XpKurr3Bcvve72w4+yNWATjs0ISH6aXIuLkYdDNIyGPia7DVaq e0c/xDMNE3AuG8Nr2t/Pxmak7xMy9eg8HO1oHsy2W+l2Fmkin3+8RUOi/7VQjz/i6ERU w15tFrSETQU7zsp4N28+bdgVPSvDOqsKvDF2Kq7ADAf+ghzkJ/LE4KiBzdfvRe/ESR4p ftfPJNLwkvp4NCgQIS77wuWYtYe1+slb47nLwh9syzlQ8po05d84TCclYvITh2oNyAqz gXPnjjwJLiIrkM+xJjOI3UKOR28tWE6A7ADtasQEyozAwVBW0sYIoyhwKmuIJre+dlU3 PMow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=oy1B972b1JrS6pdVZXJlDwfok7LryaGYSBWcqcAYpHU=; b=IKrBEGyOW1X1RkVezd6s3u/dYpkbLwxYBdkrrHuI+JyKZcEmSnmFS5zp9rF4ZKrg3/ 1KCOjf98BBPNdx2eLXTgqj7Pw1HDAkuxXa15hQSPy9LfDmjwQytpPMiJlf3pEonYAP11 hkgsK94ZaJbC5Ytm62VyDo6x7IQh1noSnEQuXUP16+LDejnOCmCbP7z8rKJd7xh6BV+2 bjNWLk0j/r2yBK4qPUP8QRcLDL7dyHMj8bhe+gfzH3fIar/RbiOt0zi9gINxRrcme3wB 2wHQpMRL9Etc52OepMtkBgAy9P2R5lsvf0374jqfSYLykyCULl93HmLG8xnFTPZ5yFX8 VIwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22-v6si24811356pfl.220.2018.09.20.05.48.52; Thu, 20 Sep 2018 05:49:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388277AbeITScH (ORCPT + 99 others); Thu, 20 Sep 2018 14:32:07 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:52453 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387764AbeITScG (ORCPT ); Thu, 20 Sep 2018 14:32:06 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 38E2C466E40A; Thu, 20 Sep 2018 20:48:40 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Thu, 20 Sep 2018 20:48:35 +0800 From: YueHaibing To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , , , , , , , YueHaibing 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 Message-ID: <20180920123306.14772-15-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20180920123306.14772-1-yuehaibing@huawei.com> References: <20180920123306.14772-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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