mt76: mt7915: use min_t() to make code cleaner
authorChangcheng Deng <deng.changcheng@zte.com.cn>
Tue, 15 Feb 2022 02:33:55 +0000 (02:33 +0000)
committerFelix Fietkau <nbd@nbd.name>
Thu, 24 Feb 2022 13:40:22 +0000 (14:40 +0100)
Use min_t() in order to make code cleaner.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/testmode.c

index 997ba9987dd9707f8c84bdcd782ecacbb95a87fc..6605e24c4593ea335c8149de98bb04a8883bf013 100644 (file)
@@ -227,12 +227,8 @@ mt7915_tm_set_ipg_params(struct mt7915_phy *phy, u32 ipg, u8 mode)
 
                ipg -= aifsn * slot_time;
 
-               if (ipg > TM_DEFAULT_SIFS) {
-                       if (ipg < TM_MAX_SIFS)
-                               sifs = ipg;
-                       else
-                               sifs = TM_MAX_SIFS;
-               }
+               if (ipg > TM_DEFAULT_SIFS)
+                       sifs = min_t(u32, ipg, TM_MAX_SIFS);
        }
 done:
        txv_time = mt76_get_field(dev, MT_TMAC_ATCR(phy->band_idx),