summary refs log tree commit diff
path: root/net/hsr/hsr_main.c
diff options
context:
space:
mode:
authorMurali Karicheri <m-karicheri2@ti.com>2019-04-05 13:31:28 -0400
committerDavid S. Miller <davem@davemloft.net>2019-04-06 18:32:21 -0700
commit05ca6e644dc9b733379009137ba4cc7afce2256d (patch)
tree9132726d5a25f4dbf393027bb1d0b7882b981f6e /net/hsr/hsr_main.c
parent0525fc069f03dfd871752eb7afc85075444c8b28 (diff)
downloadlinux-05ca6e644dc9b733379009137ba4cc7afce2256d.tar.gz
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_main.c')
-rw-r--r--net/hsr/hsr_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/hsr/hsr_main.c b/net/hsr/hsr_main.c
index 0d4ab8fc0aa1..84cacf8c1b0a 100644
--- a/net/hsr/hsr_main.c
+++ b/net/hsr/hsr_main.c
@@ -30,12 +30,12 @@ static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event,
 
 	dev = netdev_notifier_info_to_dev(ptr);
 	port = hsr_port_get_rtnl(dev);
-	if (port == NULL) {
+	if (!port) {
 		if (!is_hsr_master(dev))
 			return NOTIFY_DONE;	/* Not an HSR device */
 		hsr = netdev_priv(dev);
 		port = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
-		if (port == NULL) {
+		if (!port) {
 			/* Resend of notification concerning removed device? */
 			return NOTIFY_DONE;
 		}