realtek: Reduce variable scopes
authorOlliver Schinagl <oliver@schinagl.nl>
Thu, 22 Dec 2022 10:53:30 +0000 (11:53 +0100)
committerSander Vanheule <sander@svanheule.net>
Tue, 27 Dec 2022 15:33:15 +0000 (16:33 +0100)
commit0a83889e89b7213ea8f6eac21de50ffa3ae5a606
tree2cbdc779663e8eb848cbe3242bc5923c3922491f
parent94d8b4852b9ff0063cddfda13a96fb5449f3bd6d
realtek: Reduce variable scopes

Linus prefers to have loop initializers nice and tightly scoped. In
OpenWRT this has been possible since 41a1a652fbd4 ("kernel: backport
gnu11 upgrade").

This patch cleans up variable scope while trying to do the above for
'simple for loops'.

This cleans up and simplifies some functions and code, and pulls in
variables to a smaller scope.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
12 files changed:
target/linux/realtek/files-5.15/drivers/clk/realtek/clk-rtl83xx.c
target/linux/realtek/files-5.15/drivers/i2c/busses/i2c-rtl9300.c
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/debugfs.c
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/qos.c
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl838x.c
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl839x.c
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl930x.c
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/rtl931x.c
target/linux/realtek/files-5.15/drivers/net/ethernet/rtl838x_eth.c
target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c