From 18cfe3c1a121c275fb0a86dd7b0c049c6dd0a038 Mon Sep 17 00:00:00 2001 From: "Yury Norov (NVIDIA)" Date: Tue, 16 Sep 2025 12:35:16 -0400 Subject: [PATCH] net: renesas: rswitch: simplify rswitch_stop() rswitch_stop() opencodes for_each_set_bit(). CC: Simon Horman Reviewed-by: Nikita Yushchenko Signed-off-by: Yury Norov (NVIDIA) Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250916163516.486827-1-yury.norov@gmail.com Signed-off-by: Paolo Abeni --- drivers/net/ethernet/renesas/rswitch_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/renesas/rswitch_main.c b/drivers/net/ethernet/renesas/rswitch_main.c index ff5f966c98a98..69676db20fec6 100644 --- a/drivers/net/ethernet/renesas/rswitch_main.c +++ b/drivers/net/ethernet/renesas/rswitch_main.c @@ -1656,9 +1656,7 @@ static int rswitch_stop(struct net_device *ndev) if (bitmap_empty(rdev->priv->opened_ports, RSWITCH_NUM_PORTS)) iowrite32(GWCA_TS_IRQ_BIT, rdev->priv->addr + GWTSDID); - for (tag = find_first_bit(rdev->ts_skb_used, TS_TAGS_PER_PORT); - tag < TS_TAGS_PER_PORT; - tag = find_next_bit(rdev->ts_skb_used, TS_TAGS_PER_PORT, tag + 1)) { + for_each_set_bit(tag, rdev->ts_skb_used, TS_TAGS_PER_PORT) { ts_skb = xchg(&rdev->ts_skb[tag], NULL); clear_bit(tag, rdev->ts_skb_used); if (ts_skb) -- 2.47.3