net: hdlc: move out assignment in if condition
authorPeng Li <lipeng321@huawei.com>
Tue, 1 Jun 2021 13:23:21 +0000 (21:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Jun 2021 23:57:47 +0000 (16:57 -0700)
Should not use assignment in if condition.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/hdlc.c

index fefc7321c0c4f07b44431c9fe9b8d53e25cb35c2..f48d70e7f3ba1c71ede43de6b415983b0ea54d09 100644 (file)
@@ -212,7 +212,8 @@ int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
        /* Not handled by currently attached protocol (if any) */
 
        while (proto) {
-               if ((result = proto->ioctl(dev, ifr)) != -EINVAL)
+               result = proto->ioctl(dev, ifr);
+               if (result != -EINVAL)
                        return result;
                proto = proto->next;
        }
@@ -363,7 +364,8 @@ static int __init hdlc_module_init(void)
        int result;
 
        pr_info("%s\n", version);
-       if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0)
+       result = register_netdevice_notifier(&hdlc_notifier);
+       if (result)
                return result;
        dev_add_pack(&hdlc_packet_type);
        return 0;