diff mbox

[3/3] bridge: netfilter: checkpatch null comparison fixes

Message ID 1462843618-21914-4-git-send-email-me@tobin.cc
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Tobin C. Harding May 10, 2016, 1:26 a.m. UTC
From: Tobin C Harding <me@tobin.cc>

checkpatch produces comparison to null 'checks'.

This patch amends them.

Signed-off-by: Tobin C Harding <me@tobin.cc>
---
 net/bridge/netfilter/ebt_stp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Pablo Neira Ayuso June 7, 2016, 3:21 p.m. UTC | #1
On Tue, May 10, 2016 at 11:26:58AM +1000, tcharding wrote:
> From: Tobin C Harding <me@tobin.cc>
> 
> checkpatch produces comparison to null 'checks'.
> 
> This patch amends them.

We have quite a lot of these in the netfilter tree, so I'd rather
start using prefered coding style from now on rather than getting a
large patch to convert this. This just makes harder to pass back
patches to -stable branches as the process becomes not so immediate.
diff mbox

Patch

diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c
index 9df943f..677904f 100644
--- a/net/bridge/netfilter/ebt_stp.c
+++ b/net/bridge/netfilter/ebt_stp.c
@@ -128,7 +128,7 @@  ebt_stp_mt(const struct sk_buff *skb, struct xt_action_param *par)
 	const u8 header[6] = {0x42, 0x42, 0x03, 0x00, 0x00, 0x00};
 
 	sp = skb_header_pointer(skb, 0, sizeof(_stph), &_stph);
-	if (sp == NULL)
+	if (!sp)
 		return false;
 
 	/* The stp code only considers these */
@@ -146,7 +146,7 @@  ebt_stp_mt(const struct sk_buff *skb, struct xt_action_param *par)
 
 		st = skb_header_pointer(skb, sizeof(_stph),
 					sizeof(_stpc), &_stpc);
-		if (st == NULL)
+		if (!st)
 			return false;
 		return ebt_filter_config(info, st);
 	}