[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1622167537-74981-1-git-send-email-zou_wei@huawei.com>
Date: Fri, 28 May 2021 10:05:37 +0800
From: Zou Wei <zou_wei@...wei.com>
To: <nbd@....name>, <lorenzo.bianconi83@...il.com>,
<ryder.lee@...iatek.com>, <kvalo@...eaurora.org>,
<davem@...emloft.net>, <kuba@...nel.org>, <matthias.bgg@...il.com>
CC: <linux-wireless@...r.kernel.org>, <netdev@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, Zou Wei <zou_wei@...wei.com>
Subject: [PATCH -next] mt76: mt7915: Fix unsigned comparison to zero
Fixes coccicheck warnings:
./drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3450:5-8: WARNING: Unsigned expression compared with zero: idx < 0
Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Zou Wei <zou_wei@...wei.com>
---
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index b3f14ff..764f25a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -3440,8 +3440,9 @@ int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy)
{
struct mt7915_dev *dev = phy->dev;
struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
- u16 total = 2, idx, center_freq = chandef->center_freq1;
+ u16 total = 2, center_freq = chandef->center_freq1;
u8 *cal = dev->cal, *eep = dev->mt76.eeprom.data;
+ int idx;
if (!(eep[MT_EE_DO_PRE_CAL] & MT_EE_WIFI_CAL_DPD))
return 0;
--
2.6.2
Powered by blists - more mailing lists