diff mbox series

nfc: nci: fix warning comparison to bool

Message ID 20190608084154.GA7520@hari-Inspiron-1545
State Rejected
Delegated to: David Miller
Headers show
Series nfc: nci: fix warning comparison to bool | expand

Commit Message

Hariprasad Kelam June 8, 2019, 8:41 a.m. UTC
Fix below warning reported by coccicheck

net/nfc/nci/ntf.c:367:5-15: WARNING: Comparison to bool

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 net/nfc/nci/ntf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller June 10, 2019, 2:55 a.m. UTC | #1
From: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Date: Sat, 8 Jun 2019 14:11:54 +0530

> Fix below warning reported by coccicheck
> 
> net/nfc/nci/ntf.c:367:5-15: WARNING: Comparison to bool
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
>  net/nfc/nci/ntf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
> index 1e8c1a1..81e8570 100644
> --- a/net/nfc/nci/ntf.c
> +++ b/net/nfc/nci/ntf.c
> @@ -364,7 +364,7 @@ static void nci_rf_discover_ntf_packet(struct nci_dev *ndev,
>  	ntf.ntf_type = *data++;
>  	pr_debug("ntf_type %d\n", ntf.ntf_type);
>  
> -	if (add_target == true)
> +	if (add_target)

add_target is a bool, these kinds of changes are not good.
diff mbox series

Patch

diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 1e8c1a1..81e8570 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -364,7 +364,7 @@  static void nci_rf_discover_ntf_packet(struct nci_dev *ndev,
 	ntf.ntf_type = *data++;
 	pr_debug("ntf_type %d\n", ntf.ntf_type);
 
-	if (add_target == true)
+	if (add_target)
 		nci_add_new_target(ndev, &ntf);
 
 	if (ntf.ntf_type == NCI_DISCOVER_NTF_TYPE_MORE) {