Skip to contentSkip to conversation

net: ipw2x00: Replace NULL comparison with !priv

PATCH In review Varsha Rao 2 participants 2 messages Jun 3, 2018 – Jun 27, 2018

Subsystems (3)
lore
Share & tools
lore

Varsha Rao

author
#0 lore raw

PATCH 1/1 net: ipw2x00: Replace NULL comparison with !priv

Remove extra parentheses and replace NULL comparison with !priv, to fix clang warning of extraneous parentheses and check patch issue. Following coccinelle script is used to fix it.

@disable is_null,paren@
expression e;
statement s;
@@
if (
- (e==NULL)
+!e
)
s

---
 drivers/net/wireless/intel/ipw2x00/ipw2200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/ipw2x00/ipw2200.c +1 -1
index 87a5e414c2f7..7d55bb09413b 100644
@@ -7112,7 +7112,7 @@ static u32 ipw_qos_get_burst_duration(struct ipw_priv *priv)
 {
 	u32 ret = 0;
 
-	if ((priv == NULL))
+	if (!priv)
 		return 0;
 
 	if (!(priv->ieee->modulation & LIBIPW_OFDM_MODULATION))
Signature · 1 line
2.17.0
#1 lore raw
Quoted 14 lines · Varsha Rao

Remove extra parentheses and replace NULL comparison with !priv, to fix clang warning of extraneous parentheses and check patch issue. Following coccinelle script is used to fix it.

@disable is_null,paren@
expression e;
statement s;
@@
if (
- (e==NULL)
+!e
)
s

Quoted 1 line

Patch applied to wireless-drivers-next.git, thanks.

4e5f881d430a net: ipw2x00: Replace NULL comparison with !priv

Signature · 3 lines
https://patchwork.kernel.org/patch/10445241/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches