All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: r8723au: replace explicit NULL comparisons with !
@ 2015-10-16 16:26 Alison Schofield
  2015-10-16 16:34 ` [Outreachy kernel] " Julia Lawall
  2015-10-16 18:46 ` [PATCH v2] staging: r8723au: replace NULL and zero comparison tests with ! operator Alison Schofield
  0 siblings, 2 replies; 3+ messages in thread
From: Alison Schofield @ 2015-10-16 16:26 UTC (permalink / raw)
  To: outreachy-kernel

Replace explicit NULL comparisons with ! operator to simplify code.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
---
 drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c
index 65b209a..59bb3da 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -919,8 +919,8 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter,
 			break;
 		}
 
-		if ((p == NULL) || (ie_len == 0))
-				break;
+		if (!p || !ie_len)
+			break;
 	}
 
 	/* wmm */
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: r8723au: replace explicit NULL comparisons with !
  2015-10-16 16:26 [PATCH] staging: r8723au: replace explicit NULL comparisons with ! Alison Schofield
@ 2015-10-16 16:34 ` Julia Lawall
  2015-10-16 18:46 ` [PATCH v2] staging: r8723au: replace NULL and zero comparison tests with ! operator Alison Schofield
  1 sibling, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2015-10-16 16:34 UTC (permalink / raw)
  To: Alison Schofield; +Cc: outreachy-kernel

On Fri, 16 Oct 2015, Alison Schofield wrote:

> Replace explicit NULL comparisons with ! operator to simplify code.

They actually aren't both NULL comparisons.

julia

>
> Signed-off-by: Alison Schofield <amsfield22@gmail.com>
> ---
>  drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c
> index 65b209a..59bb3da 100644
> --- a/drivers/staging/rtl8723au/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723au/core/rtw_ap.c
> @@ -919,8 +919,8 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter,
>  			break;
>  		}
>
> -		if ((p == NULL) || (ie_len == 0))
> -				break;
> +		if (!p || !ie_len)
> +			break;
>  	}
>
>  	/* wmm */
> --
> 2.1.4
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151016162645.GA17124%40Ubuntu-D830.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] staging: r8723au: replace NULL and zero comparison tests with ! operator
  2015-10-16 16:26 [PATCH] staging: r8723au: replace explicit NULL comparisons with ! Alison Schofield
  2015-10-16 16:34 ` [Outreachy kernel] " Julia Lawall
@ 2015-10-16 18:46 ` Alison Schofield
  1 sibling, 0 replies; 3+ messages in thread
From: Alison Schofield @ 2015-10-16 18:46 UTC (permalink / raw)
  To: outreachy-kernel

Replace explicit NULL comparison and zero comparison test with ! operator
to simplify code.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
---

Change in v2: commit & description message update to include zero case.

 drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c
index 65b209a..59bb3da 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -919,8 +919,8 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter,
 			break;
 		}
 
-		if ((p == NULL) || (ie_len == 0))
-				break;
+		if (!p || !ie_len)
+			break;
 	}
 
 	/* wmm */
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-16 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 16:26 [PATCH] staging: r8723au: replace explicit NULL comparisons with ! Alison Schofield
2015-10-16 16:34 ` [Outreachy kernel] " Julia Lawall
2015-10-16 18:46 ` [PATCH v2] staging: r8723au: replace NULL and zero comparison tests with ! operator Alison Schofield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.