diff options
| author | Sven Eckelmann | 2025-11-05 08:43:36 +0000 |
|---|---|---|
| committer | Hauke Mehrtens | 2025-11-15 23:10:56 +0000 |
| commit | 501f4edb04c434ed966a9443788b2f968abca38f (patch) | |
| tree | c96f10d105e2e0d7de653df145925512820ea346 | |
| parent | e20ab65281bb8cd5b28378945a774a7540843cd2 (diff) | |
| download | openwrt-501f4edb04c434ed966a9443788b2f968abca38f.tar.gz | |
realtek: dsa: Clarify statistic port iterator variable
The functions iterating through the port statistic/counter (for
initialization or polling) use the generic name "i" for the iterator. This
makes reading the actual body of the loop cumbersome because it is not
clear that various parameters of functions are about a ports.
Suggested-by: Felix Baumann <felix.bau@gmx.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
| -rw-r--r-- | target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c index 0c20f626a7..abe45dc65e 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c @@ -1195,13 +1195,13 @@ static void rtldsa_poll_counters(struct work_struct *work) struct rtl838x_switch_priv, counters_work); - for (int i = 0; i < priv->cpu_port; i++) { - if (!priv->ports[i].phy && !priv->pcs[i]) + for (int port = 0; port < priv->cpu_port; port++) { + if (!priv->ports[port].phy && !priv->pcs[port]) continue; - rtldsa_counters_lock(priv, i); - rtldsa_update_port_counters(priv, i); - rtldsa_counters_unlock(priv, i); + rtldsa_counters_lock(priv, port); + rtldsa_update_port_counters(priv, port); + rtldsa_counters_unlock(priv, port); } queue_delayed_work(priv->wq, &priv->counters_work, @@ -1212,11 +1212,11 @@ static void rtldsa_init_counters(struct rtl838x_switch_priv *priv) { struct rtldsa_counter_state *counters; - for (int i = 0; i < priv->cpu_port; i++) { - if (!priv->ports[i].phy && !priv->pcs[i]) + for (int port = 0; port < priv->cpu_port; port++) { + if (!priv->ports[port].phy && !priv->pcs[port]) continue; - counters = &priv->ports[i].counters; + counters = &priv->ports[port].counters; memset(counters, 0, sizeof(*counters)); spin_lock_init(&counters->lock); |