rtlwifi: rtl8188ee: remove an accidental '-' character
Subsystems (2)
PATCH 1/1 rtlwifi: rtl8188ee: remove an accidental '-' character
The "->allstasleep" variable is a 1 bit bitfield. It can only be 0 or 1. This "= -1" assignement was supposed to be "= 1". This doesn't change how the code works, it's just a cleanup.
---
Found with a static checker rule that Harshit and I wrote.
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c +1 -1
@@ -694,7 +694,7 @@ void rtl88e_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state)if (P2P_ROLE_GO == rtlpriv->mac80211.p2p) { p2p_ps_offload->role =1 ; - p2p_ps_offload->allstasleep =-1 ; + p2p_ps_offload->allstasleep =1 ; }else { p2p_ps_offload->role =0 ; }
Signature · 1 line
2.51.0
Ping-Ke Shih
maintainerQuoted 4 lines · Dan Carpenter
Sent: Friday, October 31, 2025 9:04 PM
The "->allstasleep" variable is a 1 bit bitfield. It can only be 0 or 1. This "= -1" assignement was supposed to be "= 1". This doesn't change how the code works, it's just a cleanup.
Yes, this patch doesn't change logic at all. However, it looks like existing code is wrong, since other places in the same pattern in this driver set to 0. More, I check vendor driver which also sets this value to 0.
Quoted 24 lines
Signed-off-by Dan Carpenter <[email protected]>---
Found with a static checker rule that Harshit and I wrote.drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c +1
-2@@ -694,7 +694,7 @@ void rtl88e_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state)if (P2P_ROLE_GO == rtlpriv->mac80211.p2p) { p2p_ps_offload->role =1 ; - p2p_ps_offload->allstasleep =-1 ; + p2p_ps_offload->allstasleep =1 ; }else { p2p_ps_offload->role =0 ; } --2.51.0
Quoted 10 lines · Ping-Ke Shih
Quoted 4 lines · Dan Carpenter
Sent: Friday, October 31, 2025 9:04 PM
The "->allstasleep" variable is a 1 bit bitfield. It can only be 0 or 1. This "= -1" assignement was supposed to be "= 1". This doesn't change how the code works, it's just a cleanup.Yes, this patch doesn't change logic at all. However, it looks like existing code is wrong, since other places in the same pattern in this driver set to 0. More, I check vendor driver which also sets this value to 0.
Ah. Good. Thanks.
Could you send that patch and give me a Reported-by tag?
regards,
dan carpenter
Ping-Ke Shih
maintainerQuoted 7 lines · Dan Carpenter
Quoted 6 lines · Ping-Ke Shih
Quoted 4 lines · Dan Carpenter
Sent: Friday, October 31, 2025 9:04 PM
The "->allstasleep" variable is a 1 bit bitfield. It can only be 0 or 1. This "= -1" assignement was supposed to be "= 1". This doesn't change how the code works, it's just a cleanup.
Quoted 9 lines
Quoted 4 lines
Yes, this patch doesn't change logic at all. However, it looks like existing code is wrong, since other places in the same pattern in this driver set to 0. More, I check vendor driver which also sets this value to 0.
Ah. Good. Thanks.
Could you send that patch and give me a Reported-by tag?
Sent by [1].
[1] https://lore.kernel.org/linux-wireless/[email protected]/T/#u