[openwrt/openwrt] realtek: Switch booleans in rtl838x_port to single bits
LEDE Commits
lede-commits at lists.infradead.org
Sun Oct 12 03:49:54 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e696f39da816136746e37fa1a2f59349ddac28db
commit e696f39da816136746e37fa1a2f59349ddac28db
Author: Sven Eckelmann <se at simonwunderlich.de>
AuthorDate: Thu Oct 9 13:56:19 2025 +0200
realtek: Switch booleans in rtl838x_port to single bits
In upstream kernel, it is not well received to use a lot of simple booleans
in structs. It is preferred to use 1-bit bitfields [1] and consolidate the
booleans together.
[1] https://www.kernel.org/doc/html/v6.16/process/coding-style.html#using-bool
Signed-off-by: Sven Eckelmann <se at simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20360
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
index 9102442231..42b1911d9e 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
@@ -680,14 +680,14 @@ struct rtldsa_counter_state {
};
struct rtl838x_port {
- bool enable;
+ bool enable:1;
+ bool phy_is_integrated:1;
+ bool is10G:1;
+ bool is2G5:1;
u64 pm;
u16 pvid;
bool eee_enabled;
enum phy_type phy;
- bool phy_is_integrated;
- bool is10G;
- bool is2G5;
int sds_num;
int led_set;
int leds_on_this_port;
More information about the lede-commits
mailing list