Skip to content

Commit e50eb6c

Browse files
321lipengdavem330
authored andcommitted
net: hdlc: move out assignment in if condition
Should not use assignment in if condition. Signed-off-by: Peng Li <[email protected]> Signed-off-by: Guangbin Huang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 387847f commit e50eb6c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/wan/hdlc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
212212
/* Not handled by currently attached protocol (if any) */
213213

214214
while (proto) {
215-
if ((result = proto->ioctl(dev, ifr)) != -EINVAL)
215+
result = proto->ioctl(dev, ifr);
216+
if (result != -EINVAL)
216217
return result;
217218
proto = proto->next;
218219
}
@@ -363,7 +364,8 @@ static int __init hdlc_module_init(void)
363364
int result;
364365

365366
pr_info("%s\n", version);
366-
if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0)
367+
result = register_netdevice_notifier(&hdlc_notifier);
368+
if (result)
367369
return result;
368370
dev_add_pack(&hdlc_packet_type);
369371
return 0;

0 commit comments

Comments
 (0)