[PATCH] mt76: mt7915: use min_t() to make code cleaner

cgel.zte at gmail.com cgel.zte at gmail.com
Mon Feb 14 18:33:55 PST 2022


From: Changcheng Deng <deng.changcheng at zte.com.cn>

Use min_t() in order to make code cleaner.

Reported-by: Zeal Robot <zealci at zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng at zte.com.cn>
---
 drivers/net/wireless/mediatek/mt76/mt7915/testmode.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c
index 83da21d15ddd..61f255166a7f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c
@@ -228,12 +228,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(ext_phy),
-- 
2.25.1




More information about the linux-arm-kernel mailing list