Skip to content

Commit ebe8e61

Browse files
Chin-Yen LeeKalle Valo
authored andcommitted
rtw88: Fix return value of rtw_wow_check_fw_status
Clang warns that ret is used uninitialzed. And we found that actually the return type should be "int" instead of "bool". Fixes: 44bc17f ("rtw88: support wowlan feature for 8822c") Link: ClangBuiltLinux/linux#850 Reported-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Tested-by: Nathan Chancellor <natechancellor@gmail.com> # build Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent 577ddbe commit ebe8e61

File tree

1 file changed

+11
-12
lines changed
  • drivers/net/wireless/realtek/rtw88

1 file changed

+11
-12
lines changed

drivers/net/wireless/realtek/rtw88/wow.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -281,27 +281,26 @@ static void rtw_wow_rx_dma_start(struct rtw_dev *rtwdev)
281281
rtw_write32_clr(rtwdev, REG_RXPKT_NUM, BIT_RW_RELEASE);
282282
}
283283

284-
static bool rtw_wow_check_fw_status(struct rtw_dev *rtwdev, bool wow_enable)
284+
static int rtw_wow_check_fw_status(struct rtw_dev *rtwdev, bool wow_enable)
285285
{
286-
bool ret;
287-
288286
/* wait 100ms for wow firmware to finish work */
289287
msleep(100);
290288

291289
if (wow_enable) {
292-
if (!rtw_read8(rtwdev, REG_WOWLAN_WAKE_REASON))
293-
ret = 0;
290+
if (rtw_read8(rtwdev, REG_WOWLAN_WAKE_REASON))
291+
goto wow_fail;
294292
} else {
295-
if (rtw_read32_mask(rtwdev, REG_FE1IMR, BIT_FS_RXDONE) == 0 &&
296-
rtw_read32_mask(rtwdev, REG_RXPKT_NUM, BIT_RW_RELEASE) == 0)
297-
ret = 0;
293+
if (rtw_read32_mask(rtwdev, REG_FE1IMR, BIT_FS_RXDONE) ||
294+
rtw_read32_mask(rtwdev, REG_RXPKT_NUM, BIT_RW_RELEASE))
295+
goto wow_fail;
298296
}
299297

300-
if (ret)
301-
rtw_err(rtwdev, "failed to check wow status %s\n",
302-
wow_enable ? "enabled" : "disabled");
298+
return 0;
303299

304-
return ret;
300+
wow_fail:
301+
rtw_err(rtwdev, "failed to check wow status %s\n",
302+
wow_enable ? "enabled" : "disabled");
303+
return -EBUSY;
305304
}
306305

307306
static void rtw_wow_fw_security_type_iter(struct ieee80211_hw *hw,

0 commit comments

Comments
 (0)