staging: wfx: change 1 to bool
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
@@ -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
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
Signed-off-by Kaaira Gupta <[email protected]>--- drivers/staging/wfx/data_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/wfx/data_tx.c +1
-2@@ -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.
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
Signed-off-by Kaaira Gupta <[email protected]>--- drivers/staging/wfx/data_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/wfx/data_tx.c +1
-2@@ -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.
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
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
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