[openwrt/openwrt] realtek: Don't reinitialize static variables to 0

LEDE Commits lede-commits at lists.infradead.org
Mon Nov 24 15:30:12 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/612f1e6afb0bc64656b08876570b2c569f296227

commit 612f1e6afb0bc64656b08876570b2c569f296227
Author: Sven Eckelmann <sven at narfation.org>
AuthorDate: Sun Nov 23 17:04:21 2025 +0100

    realtek: Don't reinitialize static variables to 0
    
    Static variables (and global variables) are initialized to 0 by
    default. It is not needed and discouraged to reinitialize them
    to 0.
    
    Signed-off-by: Sven Eckelmann <sven at narfation.org>
    Link: https://github.com/openwrt/openwrt/pull/20906
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index 61dbb149ee..6beab1c7f3 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -1142,7 +1142,7 @@ txdone:
 static u16 rtl83xx_pick_tx_queue(struct net_device *dev, struct sk_buff *skb,
 			  struct net_device *sb_dev)
 {
-	static u8 last = 0;
+	static u8 last;
 
 	last++;
 	return last % TXRINGS;




More information about the lede-commits mailing list