Skip to content

Commit b6c10a1

Browse files
author
Ping-Ke Shih
committed
wifi: rtw89: 8852c: rfk: refine target channel calculation in _rx_dck_channel_calc()
The channel is not possibly 0, so original code is fine. Still want to avoid Coverity warning, so ensure -32 offset for the channel number which is larger than 125 only. Actually, don't change logic at all. Addresses-Coverity-ID: 1628150 ("Overflowed constant") Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent b59b86c commit b6c10a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,10 +1769,10 @@ u8 _rx_dck_channel_calc(struct rtw89_dev *rtwdev, const struct rtw89_chan *chan)
17691769
target_ch = chan->channel - 33;
17701770
}
17711771
} else if (chan->band_type == RTW89_BAND_6G) {
1772-
if (chan->channel >= 1 && chan->channel <= 125)
1773-
target_ch = chan->channel + 32;
1774-
else
1772+
if (chan->channel > 125)
17751773
target_ch = chan->channel - 32;
1774+
else
1775+
target_ch = chan->channel + 32;
17761776
} else {
17771777
target_ch = chan->channel;
17781778
}

0 commit comments

Comments
 (0)