realtek: Avoid braces around single statement blocks
authorSven Eckelmann <[email protected]>
Sun, 23 Nov 2025 12:17:31 +0000 (13:17 +0100)
committerHauke Mehrtens <[email protected]>
Mon, 24 Nov 2025 23:28:49 +0000 (00:28 +0100)
The Linux kernel coding style prefers not to use braces around blocks which
are only one statement long.

Signed-off-by: Sven Eckelmann <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/qos.c
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c

index 88dbab8b6a70f182d1eb17128089e80cd73b7322..70ca846af05279792283662332e6e72ae821a83f 100644 (file)
@@ -2219,9 +2219,9 @@ static int rtl83xx_vlan_del(struct dsa_switch *ds, int port,
        pvid = priv->ports[port].pvid;
 
        /* Reset to default if removing the current PVID */
-       if (vlan->vid == pvid) {
+       if (vlan->vid == pvid)
                rtl83xx_vlan_set_pvid(priv, port, 0);
-       }
+
        /* Get port memberships of this vlan */
        priv->r->vlan_tables_read(vlan->vid, &info);
 
@@ -2821,9 +2821,9 @@ static bool rtl83xx_lag_can_offload(struct dsa_switch *ds,
        if (id < 0 || id >= ds->num_lag_ids)
                return false;
 
-       if (info->tx_type != NETDEV_LAG_TX_TYPE_HASH) {
+       if (info->tx_type != NETDEV_LAG_TX_TYPE_HASH)
                return false;
-       }
+
        if (info->hash_type != NETDEV_LAG_HASH_L2 && info->hash_type != NETDEV_LAG_HASH_L23)
                return false;
 
index c1e795e80c8613cde2213ce981b43bd16aab8f47..3d8a6e9acbb5ee20f22fc5285c0ea81db9fcf7e6 100644 (file)
@@ -323,11 +323,11 @@ static void rtl83xx_setup_prio2queue_cpu_matrix(int *max_queues)
 
 static void rtl83xx_setup_default_prio2queue(void)
 {
-       if (soc_info.family == RTL8380_FAMILY_ID) {
+       if (soc_info.family == RTL8380_FAMILY_ID)
                rtl838x_setup_prio2queue_matrix(rtldsa_max_available_queue);
-       } else {
+       else
                rtl839x_setup_prio2queue_matrix(rtldsa_max_available_queue);
-       }
+
        rtl83xx_setup_prio2queue_cpu_matrix(rtldsa_max_available_queue);
 }
 
index 3c8ec9043a9bcda41487bea8a9ceec5e5a2ca6a7..c794d21958bc25bdfc999b31a73c41ff856b4bde 100644 (file)
@@ -622,9 +622,8 @@ static void rtpcs_930x_sds_mode_set(struct rtpcs_ctrl *ctrl, int sds,
        rtpcs_930x_sds_set(ctrl, sds, mode);
 
        /* Set the submode if needed. */
-       if (phy_mode == PHY_INTERFACE_MODE_10G_QXGMII) {
+       if (phy_mode == PHY_INTERFACE_MODE_10G_QXGMII)
                rtpcs_930x_sds_submode_set(ctrl, sds, submode);
-       }
 }
 
 
@@ -1844,9 +1843,8 @@ static void rtpcs_930x_sds_patch(struct rtpcs_ctrl *ctrl, int sds, phy_interface
                return;
        }
 
-       for (size_t i = 0; i < count; ++i) {
+       for (size_t i = 0; i < count; ++i)
                rtpcs_sds_write(ctrl, sds, config[i].page, config[i].reg, config[i].data);
-       }
 
        if (mode == PHY_INTERFACE_MODE_10G_QXGMII) {
                /* Default configuration */
@@ -2148,9 +2146,8 @@ static void rtpcs_931x_sds_cmu_type_set(struct rtpcs_ctrl *ctrl, u32 sds,
                pr_info("%s A CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
                rtpcs_sds_write_bits(ctrl, sds, cmu_page, 0x7, 15, 15, 0);
                pr_info("%s B CMU page 0x28 0x7 %08x\n", __func__, rtpcs_sds_read(ctrl, sds, 0x28, 0x7));
-               if (chiptype) {
+               if (chiptype)
                        rtpcs_sds_write_bits(ctrl, sds, cmu_page, 0xd, 14, 14, 0);
-               }
 
                rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, 3, 2, 0x3);
                rtpcs_sds_write_bits(ctrl, evenSds, 0x20, 0x12, frc_lc_mode_bitnum, frc_lc_mode_bitnum, 1);
@@ -2507,12 +2504,12 @@ static int rtpcs_931x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
                        val = 0xa0000;
                        regmap_write(ctrl->map, RTL93XX_CHIP_INFO, val);
                        regmap_read(ctrl->map, RTL93XX_CHIP_INFO, &val);
+
                        if (val & BIT(28)) /* consider 9311 etc. RTL9313_CHIP_ID == HWP_CHIP_ID(unit)) */
-                       {
                                rtpcs_sds_write(ctrl, sds, 0x2E, 0x1, board_sds_tx2[sds - 2]);
-                       } else {
+                       else
                                rtpcs_sds_write(ctrl, sds, 0x2E, 0x1, board_sds_tx[sds - 2]);
-                       }
+
                        val = 0;
                        regmap_write(ctrl->map, RTL93XX_CHIP_INFO, val);
                }