diff options
author | Peng Li <lipeng321@huawei.com> | 2021-06-01 21:23:21 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-01 16:57:47 -0700 |
commit | e50eb6c3578c6bd7c43c30bfa40a882f0815a2d2 (patch) | |
tree | 8a81a85aca20ee0aef042cc9c707f734d4f4af8a /drivers/net/wan/hdlc.c | |
parent | 387847f295c86fe72693178ed1eab000154f98ff (diff) |
net: hdlc: move out assignment in if condition
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>
Diffstat (limited to 'drivers/net/wan/hdlc.c')
-rw-r--r-- | drivers/net/wan/hdlc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index fefc7321c0c4..f48d70e7f3ba 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c @@ -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; |