diff options
author | Murali Karicheri <m-karicheri2@ti.com> | 2019-04-05 13:31:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-06 18:32:21 -0700 |
commit | 05ca6e644dc9b733379009137ba4cc7afce2256d (patch) | |
tree | 9132726d5a25f4dbf393027bb1d0b7882b981f6e /net/hsr/hsr_forward.c | |
parent | 0525fc069f03dfd871752eb7afc85075444c8b28 (diff) | |
download | lwn-05ca6e644dc9b733379009137ba4cc7afce2256d.tar.gz lwn-05ca6e644dc9b733379009137ba4cc7afce2256d.zip |
net: hsr: fix NULL checks in the code
This patch replaces all instance of NULL checks such as
if (foo == NULL) with if (!foo)
Also
if (foo != NULL) with if (foo)
This is seen when ran checkpatch.pl -f on files under net/hsr
and suggestion is to replace as above.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr/hsr_forward.c')
-rw-r--r-- | net/hsr/hsr_forward.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index fdc191015208..68ca775d3be8 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -97,7 +97,7 @@ static struct sk_buff *create_stripped_skb(struct sk_buff *skb_in, skb_pull(skb_in, HSR_HLEN); skb = __pskb_copy(skb_in, skb_headroom(skb_in) - HSR_HLEN, GFP_ATOMIC); skb_push(skb_in, HSR_HLEN); - if (skb == NULL) + if (!skb) return NULL; skb_reset_mac_header(skb); @@ -160,7 +160,7 @@ static struct sk_buff *create_tagged_skb(struct sk_buff *skb_o, /* Create the new skb with enough headroom to fit the HSR tag */ skb = __pskb_copy(skb_o, skb_headroom(skb_o) + HSR_HLEN, GFP_ATOMIC); - if (skb == NULL) + if (!skb) return NULL; skb_reset_mac_header(skb); @@ -277,7 +277,7 @@ static void hsr_forward_do(struct hsr_frame_info *frame) skb = frame_get_tagged_skb(frame, port); else skb = frame_get_stripped_skb(frame, port); - if (skb == NULL) { + if (!skb) { /* FIXME: Record the dropped frame? */ continue; } @@ -317,7 +317,7 @@ static int hsr_fill_frame_info(struct hsr_frame_info *frame, frame->is_supervision = is_supervision_frame(port->hsr, skb); frame->node_src = hsr_get_node(port, skb, frame->is_supervision); - if (frame->node_src == NULL) + if (!frame->node_src) return -1; /* Unknown node and !is_supervision, or no mem */ ethhdr = (struct ethhdr *) skb_mac_header(skb); @@ -364,9 +364,9 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port) hsr_register_frame_in(frame.node_src, port, frame.sequence_nr); hsr_forward_do(&frame); - if (frame.skb_hsr != NULL) + if (frame.skb_hsr) kfree_skb(frame.skb_hsr); - if (frame.skb_std != NULL) + if (frame.skb_std) kfree_skb(frame.skb_std); return; |