Thread (9 messages) flat view 9 messages, 2 authors, 2021-06-02
STALE1905d

[PATCH net-next 6/7] net: hdlc: move out assignment in if condition

From: Guangbin Huang <hidden>
Date: 2021-06-01 13:26:51
Also in: lkml
Subsystem: generic hdlc (wan) drivers, networking drivers, the rest · Maintainers: Krzysztof Halasa, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Peng Li <redacted>

Should not use assignment in if condition.

Signed-off-by: Peng Li <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
 drivers/net/wan/hdlc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c
index fefc732..f48d70e 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;
-- 
2.8.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help