Skip to contentSkip to conversation

staging: wfx: change 1 to bool

PATCH In review Kaaira Gupta 3 participants 6 messages Mar 9, 2020 – Mar 10, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 3/7 staging: wfx: change 1 to bool

policies[i].uploaded is a bool. It is equated to 1. Change it to bool.

---
 drivers/staging/wfx/data_tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wfx/data_tx.c +1 -1
index 815fde0913f5..ef617347abad 100644
@@ -227,7 +227,7 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif)
 			    memzcmp(policies[i].rates, sizeof(policies[i].rates)))
 				break;
 		if (i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES) {
-			policies[i].uploaded = 1;
+			policies[i].uploaded = true;
 			memcpy(tmp_rates, policies[i].rates, sizeof(tmp_rates));
 			spin_unlock_bh(&wvif->tx_policy_cache.lock);
 			hif_set_tx_rate_retry_policy(wvif, i, tmp_rates);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 1 line · Kaaira Gupta

policies[i].uploaded is a bool. It is equated to 1. Change it to bool.

equated -> assigned

As far as I can see, policies[i].uploaded is a u8, not a bool. Have you checked that all of the uses indicate that it is used in a boolean way?

julia

Quoted 27 lines
---
 drivers/staging/wfx/data_tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wfx/data_tx.c +1 -2
index 815fde0913f5..ef617347abad 100644
@@ -227,7 +227,7 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif)
 			    memzcmp(policies[i].rates, sizeof(policies[i].rates)))
 				break;
 		if (i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES) {
-			policies[i].uploaded = 1;
+			policies[i].uploaded = true;
 			memcpy(tmp_rates, policies[i].rates, sizeof(tmp_rates));
 			spin_unlock_bh(&wvif->tx_policy_cache.lock);
 			hif_set_tx_rate_retry_policy(wvif, i, tmp_rates);
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200309223751.GA5676%40kaaira-HP-Pavilion-Notebook.

#2 lore raw
Quoted 8 lines · Julia Lawall
Quoted 1 line · Kaaira Gupta

policies[i].uploaded is a bool. It is equated to 1. Change it to bool.

equated -> assigned

As far as I can see, policies[i].uploaded is a u8, not a bool. Have you checked that all of the uses indicate that it is used in a boolean way?

Yes, I got this warning using coccinelle, after which I checked a few uses of this as well. I found them to be indiacate policies[i].uploaded as bool. For example line 227 of the same file :

`if (!policies[i].uploaded && memzcmp(policies[i].rates,
sizeof(policies[i].rates)`

Quoted 30 lines

julia

Quoted 27 lines
---
 drivers/staging/wfx/data_tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wfx/data_tx.c +1 -2
index 815fde0913f5..ef617347abad 100644
@@ -227,7 +227,7 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif)
 			    memzcmp(policies[i].rates, sizeof(policies[i].rates)))
 				break;
 		if (i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES) {
-			policies[i].uploaded = 1;
+			policies[i].uploaded = true;
 			memcpy(tmp_rates, policies[i].rates, sizeof(tmp_rates));
 			spin_unlock_bh(&wvif->tx_policy_cache.lock);
 			hif_set_tx_rate_retry_policy(wvif, i, tmp_rates);
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200309223751.GA5676%40kaaira-HP-Pavilion-Notebook.

#3 lore raw
Quoted 10 lines · On Tuesday 10 March 2020 13:12:42 CET Kaaira Gupta wrote:
Quoted 8 lines · Julia Lawall
Quoted 1 line · Kaaira Gupta

policies[i].uploaded is a bool. It is equated to 1. Change it to bool.

equated -> assigned

As far as I can see, policies[i].uploaded is a u8, not a bool. Have you checked that all of the uses indicate that it is used in a boolean way?

Quoted 7 lines

Yes, I got this warning using coccinelle, after which I checked a few uses of this as well. I found them to be indiacate policies[i].uploaded as bool. For example line 227 of the same file :

`if (!policies[i].uploaded && memzcmp(policies[i].rates,
sizeof(policies[i].rates)`

Hello,

Indeed, policies[i].uploaded is a bool since 6673f2636b41 ("staging: wfx:
use boolean appropriately").

Signature · 1 line
Jérôme Pouiller
#4 lore raw
Quoted 15 lines · J�r�me Pouiller
Quoted 14 lines · On Tuesday 10 March 2020 13:12:42 CET Kaaira Gupta wrote:
Quoted 8 lines · Julia Lawall
Quoted 1 line · Kaaira Gupta

policies[i].uploaded is a bool. It is equated to 1. Change it to bool.

equated -> assigned

As far as I can see, policies[i].uploaded is a u8, not a bool. Have you checked that all of the uses indicate that it is used in a boolean way?

Yes, I got this warning using coccinelle, after which I checked a few uses of this as well. I found them to be indiacate policies[i].uploaded as bool. For example line 227 of the same file :

Quoted 8 lines
Quoted 3 lines

`if (!policies[i].uploaded && memzcmp(policies[i].rates,
sizeof(policies[i].rates)`

Hello,

Indeed, policies[i].uploaded is a bool since 6673f2636b41 ("staging: wfx:
use boolean appropriately").

Indeed. I was looking at a totally unrelated structure having the same name...

thanks,
julia

#5 lore raw
Quoted 23 lines · Julia Lawall
Quoted 19 lines · J�r�me Pouiller
Quoted 17 lines · On Tuesday 10 March 2020 13:12:42 CET Kaaira Gupta wrote:
Quoted 8 lines · Julia Lawall
Quoted 1 line · Kaaira Gupta

policies[i].uploaded is a bool. It is equated to 1. Change it to bool.

equated -> assigned

As far as I can see, policies[i].uploaded is a u8, not a bool. Have you checked that all of the uses indicate that it is used in a boolean way?

Yes, I got this warning using coccinelle, after which I checked a few uses of this as well. I found them to be indiacate policies[i].uploaded as bool. For example line 227 of the same file :

`if (!policies[i].uploaded && memzcmp(policies[i].rates,
sizeof(policies[i].rates)`

Quoted 7 lines
Quoted 4 lines

Hello,

Indeed, policies[i].uploaded is a bool since 6673f2636b41 ("staging: wfx:
use boolean appropriately").

Indeed. I was looking at a totally unrelated structure having the same name...

Okay! I'll send them in a proper patch set now :p
Thanks!!

Quoted 3 lines

thanks,
julia