diff options
| author | Sven Eckelmann | 2025-11-04 11:14:58 +0000 |
|---|---|---|
| committer | Álvaro Fernández Rojas | 2025-11-06 09:32:41 +0000 |
| commit | 4ed96e54cd811c50ce1f5ef7d074fccc9d6a54a5 (patch) | |
| tree | 88a27e4ba207e1f4684a10fe6734a8880379b67b | |
| parent | 78bf3a5f44bf8219a8e0e4c982ccb7624d967f83 (diff) | |
| download | openwrt-4ed96e54cd811c50ce1f5ef7d074fccc9d6a54a5.tar.gz | |
realtek: dsa: Simplify rtl83xx_setup_qos
It is not necessary to have two different family_id checks directly after
another. It is simpler to just combine both into one.
Suggested-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20637
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
| -rw-r--r-- | target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/qos.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/qos.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/qos.c index 55145b5fcf..4794ea9576 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/qos.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/qos.c @@ -553,13 +553,14 @@ void __init rtl83xx_setup_qos(struct rtl838x_switch_priv *priv) pr_info("In %s\n", __func__); - if (priv->family_id == RTL8380_FAMILY_ID) + switch (priv->family_id) { + case RTL8380_FAMILY_ID: rtl838x_config_qos(); - else if (priv->family_id == RTL8390_FAMILY_ID) - rtl839x_config_qos(); - - if (priv->family_id == RTL8380_FAMILY_ID) rtl838x_rate_control_init(priv); - else if (priv->family_id == RTL8390_FAMILY_ID) + break; + case RTL8390_FAMILY_ID: + rtl839x_config_qos(); rtl839x_rate_control_init(priv); + break; + } } |