realtek: dsa: Simplify rtl83xx_setup_qos
authorSven Eckelmann <[email protected]>
Tue, 4 Nov 2025 11:14:58 +0000 (12:14 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Thu, 6 Nov 2025 09:32:41 +0000 (10:32 +0100)
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 <[email protected]>
Signed-off-by: Sven Eckelmann <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20637
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/qos.c

index 55145b5fcfd9315265fc227f9973492e26fb7e96..4794ea9576848effce1acb5a914e0b7772429041 100644 (file)
@@ -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;
+       }
 }