Commit c7e00223 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by David S. Miller

net: rswitch: Drop unused argument/return value

Drop unused argument and return value of rswitch_tx_free() to
simplify the code.
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1674110c
...@@ -761,20 +761,19 @@ static bool rswitch_rx(struct net_device *ndev, int *quota) ...@@ -761,20 +761,19 @@ static bool rswitch_rx(struct net_device *ndev, int *quota)
return 0; return 0;
} }
static int rswitch_tx_free(struct net_device *ndev, bool free_txed_only) static void rswitch_tx_free(struct net_device *ndev)
{ {
struct rswitch_device *rdev = netdev_priv(ndev); struct rswitch_device *rdev = netdev_priv(ndev);
struct rswitch_gwca_queue *gq = rdev->tx_queue; struct rswitch_gwca_queue *gq = rdev->tx_queue;
struct rswitch_ext_desc *desc; struct rswitch_ext_desc *desc;
dma_addr_t dma_addr; dma_addr_t dma_addr;
struct sk_buff *skb; struct sk_buff *skb;
int free_num = 0;
int size; int size;
for (; rswitch_get_num_cur_queues(gq) > 0; for (; rswitch_get_num_cur_queues(gq) > 0;
gq->dirty = rswitch_next_queue_index(gq, false, 1)) { gq->dirty = rswitch_next_queue_index(gq, false, 1)) {
desc = &gq->tx_ring[gq->dirty]; desc = &gq->tx_ring[gq->dirty];
if (free_txed_only && (desc->desc.die_dt & DT_MASK) != DT_FEMPTY) if ((desc->desc.die_dt & DT_MASK) != DT_FEMPTY)
break; break;
dma_rmb(); dma_rmb();
...@@ -786,14 +785,11 @@ static int rswitch_tx_free(struct net_device *ndev, bool free_txed_only) ...@@ -786,14 +785,11 @@ static int rswitch_tx_free(struct net_device *ndev, bool free_txed_only)
size, DMA_TO_DEVICE); size, DMA_TO_DEVICE);
dev_kfree_skb_any(gq->skbs[gq->dirty]); dev_kfree_skb_any(gq->skbs[gq->dirty]);
gq->skbs[gq->dirty] = NULL; gq->skbs[gq->dirty] = NULL;
free_num++;
} }
desc->desc.die_dt = DT_EEMPTY; desc->desc.die_dt = DT_EEMPTY;
rdev->ndev->stats.tx_packets++; rdev->ndev->stats.tx_packets++;
rdev->ndev->stats.tx_bytes += size; rdev->ndev->stats.tx_bytes += size;
} }
return free_num;
} }
static int rswitch_poll(struct napi_struct *napi, int budget) static int rswitch_poll(struct napi_struct *napi, int budget)
...@@ -808,7 +804,7 @@ static int rswitch_poll(struct napi_struct *napi, int budget) ...@@ -808,7 +804,7 @@ static int rswitch_poll(struct napi_struct *napi, int budget)
priv = rdev->priv; priv = rdev->priv;
retry: retry:
rswitch_tx_free(ndev, true); rswitch_tx_free(ndev);
if (rswitch_rx(ndev, &quota)) if (rswitch_rx(ndev, &quota))
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment