Commit 9208e85c authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

wifi: rtlwifi: set initial values for unexpected cases of USB endpoint priority

Map USB endpoints to hardware and AC queues according to number of USB
endpoints. However, original only give a warning for unexpected cases but
initial values are not given. Then, smatch warns:

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:642
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:644
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:649
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:650
  _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.

The regular selection is high and low queues, so move default (unexpected)
case along with that.

Compile tested only.
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240216033949.34765-1-pkshih@realtek.com
parent 513c559c
...@@ -622,6 +622,9 @@ static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw, ...@@ -622,6 +622,9 @@ static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw,
u16 valuelow; u16 valuelow;
switch (queue_sel) { switch (queue_sel) {
default:
WARN_ON(1);
fallthrough;
case (TX_SELE_HQ | TX_SELE_LQ): case (TX_SELE_HQ | TX_SELE_LQ):
valuehi = QUEUE_HIGH; valuehi = QUEUE_HIGH;
valuelow = QUEUE_LOW; valuelow = QUEUE_LOW;
...@@ -634,9 +637,6 @@ static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw, ...@@ -634,9 +637,6 @@ static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw,
valuehi = QUEUE_HIGH; valuehi = QUEUE_HIGH;
valuelow = QUEUE_NORMAL; valuelow = QUEUE_NORMAL;
break; break;
default:
WARN_ON(1);
break;
} }
if (!wmm_enable) { if (!wmm_enable) {
beq = valuelow; beq = valuelow;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment