Skip to content

Commit 2a584b1

Browse files
shimodaygregkh
authored andcommitted
net: rswitch: Drop unused argument/return value
[ Upstream commit c7e0022 ] Drop unused argument and return value of rswitch_tx_free() to simplify the code. Signed-off-by: Yoshihiro Shimoda <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: David S. Miller <[email protected]> Stable-dep-of: 0c9547e ("net: renesas: rswitch: fix race window between tx start and complete") Signed-off-by: Sasha Levin <[email protected]>
1 parent f789f9d commit 2a584b1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/net/ethernet/renesas/rswitch.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -760,20 +760,19 @@ static bool rswitch_rx(struct net_device *ndev, int *quota)
760760
return 0;
761761
}
762762

763-
static int rswitch_tx_free(struct net_device *ndev, bool free_txed_only)
763+
static void rswitch_tx_free(struct net_device *ndev)
764764
{
765765
struct rswitch_device *rdev = netdev_priv(ndev);
766766
struct rswitch_gwca_queue *gq = rdev->tx_queue;
767767
struct rswitch_ext_desc *desc;
768768
dma_addr_t dma_addr;
769769
struct sk_buff *skb;
770-
int free_num = 0;
771770
int size;
772771

773772
for (; rswitch_get_num_cur_queues(gq) > 0;
774773
gq->dirty = rswitch_next_queue_index(gq, false, 1)) {
775774
desc = &gq->tx_ring[gq->dirty];
776-
if (free_txed_only && (desc->desc.die_dt & DT_MASK) != DT_FEMPTY)
775+
if ((desc->desc.die_dt & DT_MASK) != DT_FEMPTY)
777776
break;
778777

779778
dma_rmb();
@@ -785,14 +784,11 @@ static int rswitch_tx_free(struct net_device *ndev, bool free_txed_only)
785784
size, DMA_TO_DEVICE);
786785
dev_kfree_skb_any(gq->skbs[gq->dirty]);
787786
gq->skbs[gq->dirty] = NULL;
788-
free_num++;
789787
}
790788
desc->desc.die_dt = DT_EEMPTY;
791789
rdev->ndev->stats.tx_packets++;
792790
rdev->ndev->stats.tx_bytes += size;
793791
}
794-
795-
return free_num;
796792
}
797793

798794
static int rswitch_poll(struct napi_struct *napi, int budget)
@@ -807,7 +803,7 @@ static int rswitch_poll(struct napi_struct *napi, int budget)
807803
priv = rdev->priv;
808804

809805
retry:
810-
rswitch_tx_free(ndev, true);
806+
rswitch_tx_free(ndev);
811807

812808
if (rswitch_rx(ndev, &quota))
813809
goto out;

0 commit comments

Comments
 (0)