Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: synclink.c: move assignment out of if () block

We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+10 -5
+10 -5
drivers/tty/synclink.c
··· 4410 4410 printk("Unloading %s: %s\n", driver_name, driver_version); 4411 4411 4412 4412 if (serial_driver) { 4413 - if ((rc = tty_unregister_driver(serial_driver))) 4413 + rc = tty_unregister_driver(serial_driver); 4414 + if (rc) 4414 4415 printk("%s(%d) failed to unregister tty driver err=%d\n", 4415 4416 __FILE__,__LINE__,rc); 4416 4417 put_tty_driver(serial_driver); ··· 7752 7751 printk("%s:hdlcdev_open(%s)\n",__FILE__,dev->name); 7753 7752 7754 7753 /* generic HDLC layer open processing */ 7755 - if ((rc = hdlc_open(dev))) 7754 + rc = hdlc_open(dev); 7755 + if (rc) 7756 7756 return rc; 7757 7757 7758 7758 /* arbitrate between network and tty opens */ ··· 8020 8018 8021 8019 /* allocate and initialize network and HDLC layer objects */ 8022 8020 8023 - if (!(dev = alloc_hdlcdev(info))) { 8021 + dev = alloc_hdlcdev(info); 8022 + if (!dev) { 8024 8023 printk(KERN_ERR "%s:hdlc device allocation failure\n",__FILE__); 8025 8024 return -ENOMEM; 8026 8025 } ··· 8042 8039 hdlc->xmit = hdlcdev_xmit; 8043 8040 8044 8041 /* register objects with HDLC layer */ 8045 - if ((rc = register_hdlc_device(dev))) { 8042 + rc = register_hdlc_device(dev); 8043 + if (rc) { 8046 8044 printk(KERN_WARNING "%s:unable to register hdlc device\n",__FILE__); 8047 8045 free_netdev(dev); 8048 8046 return rc; ··· 8079 8075 return -EIO; 8080 8076 } 8081 8077 8082 - if (!(info = mgsl_allocate_device())) { 8078 + info = mgsl_allocate_device(); 8079 + if (!info) { 8083 8080 printk("can't allocate device instance data.\n"); 8084 8081 return -EIO; 8085 8082 }