diff mbox series

brcmfmac: remove Comparison to bool in brcmf_p2p_send_action_frame()

Message ID 20200504113346.41342-1-yanaijie@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series brcmfmac: remove Comparison to bool in brcmf_p2p_send_action_frame() | expand

Commit Message

Jason Yan May 4, 2020, 11:33 a.m. UTC
Fix the following coccicheck warning:

drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1781:9-12:
WARNING: Comparison to bool
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1785:5-8:
WARNING: Comparison to bool

Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Chi-Hsien Lin May 5, 2020, 7:50 a.m. UTC | #1
On 05/04/2020 7:33, Jason Yan wrote:
> Fix the following coccicheck warning:
> 
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1781:9-12:
> WARNING: Comparison to bool
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1785:5-8:
> WARNING: Comparison to bool
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
Reviewed-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>

> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
> index 1f5deea5a288..16b193d13a2f 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
> @@ -1777,12 +1777,11 @@ bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
>   	}
>   
>   	tx_retry = 0;
> -	while (!p2p->block_gon_req_tx &&
> -	       (ack == false) && (tx_retry < P2P_AF_TX_MAX_RETRY)) {
> +	while (!p2p->block_gon_req_tx && !ack && (tx_retry < P2P_AF_TX_MAX_RETRY)) {
>   		ack = !brcmf_p2p_tx_action_frame(p2p, af_params);
>   		tx_retry++;
>   	}
> -	if (ack == false) {
> +	if (!ack) {
>   		bphy_err(drvr, "Failed to send Action Frame(retry %d)\n",
>   			 tx_retry);
>   		clear_bit(BRCMF_P2P_STATUS_GO_NEG_PHASE, &p2p->status);
>
Kalle Valo May 6, 2020, 8:41 a.m. UTC | #2
Jason Yan <yanaijie@huawei.com> wrote:

> Fix the following coccicheck warning:
> 
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1781:9-12:
> WARNING: Comparison to bool
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1785:5-8:
> WARNING: Comparison to bool
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> Reviewed-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>

Failed to apply, please rebase to top of wireless-drivers-next and send
v2.

Recorded preimage for 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c'
error: Failed to merge in the changes.
Applying: brcmfmac: remove Comparison to bool in brcmf_p2p_send_action_frame()
Using index info to reconstruct a base tree...
M	drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
CONFLICT (content): Merge conflict in drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
Patch failed at 0001 brcmfmac: remove Comparison to bool in brcmf_p2p_send_action_frame()
The copy of the patch that failed is found in: .git/rebase-apply/patch

Patch set to Changes Requested.
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index 1f5deea5a288..16b193d13a2f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -1777,12 +1777,11 @@  bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
 	}
 
 	tx_retry = 0;
-	while (!p2p->block_gon_req_tx &&
-	       (ack == false) && (tx_retry < P2P_AF_TX_MAX_RETRY)) {
+	while (!p2p->block_gon_req_tx && !ack && (tx_retry < P2P_AF_TX_MAX_RETRY)) {
 		ack = !brcmf_p2p_tx_action_frame(p2p, af_params);
 		tx_retry++;
 	}
-	if (ack == false) {
+	if (!ack) {
 		bphy_err(drvr, "Failed to send Action Frame(retry %d)\n",
 			 tx_retry);
 		clear_bit(BRCMF_P2P_STATUS_GO_NEG_PHASE, &p2p->status);