Skip to contentSkip to conversation

staging: r8723au: replace explicit NULL comparisons with !

PATCH In review Alison Schofield 2 participants 3 messages Oct 16, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: r8723au: replace explicit NULL comparisons with !

Replace explicit NULL comparisons with ! operator to simplify code.

---
 drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723au/core/rtw_ap.c +2 -2
index 65b209a..59bb3da 100644
@@ -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 */
Signature · 1 line
2.1.4
#1 lore raw
Quoted 1 line · Alison Schofield

Replace explicit NULL comparisons with ! operator to simplify code.

They actually aren't both NULL comparisons.

julia

Quoted 31 lines
---
 drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723au/core/rtw_ap.c +2 -3
index 65b209a..59bb3da 100644
@@ -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 [email protected]. To post to this group, send email to [email protected].
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.

#2 lore raw

PATCH v2 1/1 staging: r8723au: replace NULL and zero comparison tests with ! operator

In reply to Alison Schofield

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

---

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(-)
drivers/staging/rtl8723au/core/rtw_ap.c +2 -2
index 65b209a..59bb3da 100644
@@ -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 */
Signature · 1 line
2.1.4