summaryrefslogtreecommitdiffstats
path: root/net/hsr/hsr_slave.c
diff options
context:
space:
mode:
authorMurali Karicheri <m-karicheri2@ti.com>2019-04-05 19:31:28 +0200
committerDavid S. Miller <davem@davemloft.net>2019-04-07 03:32:21 +0200
commit05ca6e644dc9b733379009137ba4cc7afce2256d (patch)
tree9132726d5a25f4dbf393027bb1d0b7882b981f6e /net/hsr/hsr_slave.c
parentnet: hsr: fix lines that ends with a '(' (diff)
downloadlinux-05ca6e644dc9b733379009137ba4cc7afce2256d.tar.xz
linux-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_slave.c')
-rw-r--r--net/hsr/hsr_slave.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
index d506c694ee25..07cbc2ead64d 100644
--- a/net/hsr/hsr_slave.c
+++ b/net/hsr/hsr_slave.c
@@ -140,11 +140,11 @@ int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev,
}
port = hsr_port_get_hsr(hsr, type);
- if (port != NULL)
+ if (port)
return -EBUSY; /* This port already exists */
port = kzalloc(sizeof(*port), GFP_KERNEL);
- if (port == NULL)
+ if (!port)
return -ENOMEM;
if (type != HSR_PT_MASTER) {
@@ -181,7 +181,7 @@ void hsr_del_port(struct hsr_port *port)
list_del_rcu(&port->port_list);
if (port != master) {
- if (master != NULL) {
+ if (master) {
netdev_update_features(master->dev);
dev_set_mtu(master->dev, hsr_get_max_mtu(hsr));
}