aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/synclinkmp.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-30 05:22:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-10 13:04:18 -0400
commit485e148d11829025b9195cc8baf0ab6cc6a19558 (patch)
tree74021d839d54a52dc3367d37e27dde7d5d977c05 /drivers/tty/synclinkmp.c
parent3236133efedb39e9e6bac2bf242c181b58dc0928 (diff)
tty: synclinkmp.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>
Diffstat (limited to 'drivers/tty/synclinkmp.c')
-rw-r--r--drivers/tty/synclinkmp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
index c3f90910fed9..08633a8139ff 100644
--- a/drivers/tty/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -1655,7 +1655,8 @@ static int hdlcdev_open(struct net_device *dev)
1655 printk("%s:hdlcdev_open(%s)\n",__FILE__,dev->name); 1655 printk("%s:hdlcdev_open(%s)\n",__FILE__,dev->name);
1656 1656
1657 /* generic HDLC layer open processing */ 1657 /* generic HDLC layer open processing */
1658 if ((rc = hdlc_open(dev))) 1658 rc = hdlc_open(dev);
1659 if (rc)
1659 return rc; 1660 return rc;
1660 1661
1661 /* arbitrate between network and tty opens */ 1662 /* arbitrate between network and tty opens */
@@ -1922,7 +1923,8 @@ static int hdlcdev_init(SLMP_INFO *info)
1922 1923
1923 /* allocate and initialize network and HDLC layer objects */ 1924 /* allocate and initialize network and HDLC layer objects */
1924 1925
1925 if (!(dev = alloc_hdlcdev(info))) { 1926 dev = alloc_hdlcdev(info);
1927 if (!dev) {
1926 printk(KERN_ERR "%s:hdlc device allocation failure\n",__FILE__); 1928 printk(KERN_ERR "%s:hdlc device allocation failure\n",__FILE__);
1927 return -ENOMEM; 1929 return -ENOMEM;
1928 } 1930 }
@@ -1943,7 +1945,8 @@ static int hdlcdev_init(SLMP_INFO *info)
1943 hdlc->xmit = hdlcdev_xmit; 1945 hdlc->xmit = hdlcdev_xmit;
1944 1946
1945 /* register objects with HDLC layer */ 1947 /* register objects with HDLC layer */
1946 if ((rc = register_hdlc_device(dev))) { 1948 rc = register_hdlc_device(dev);
1949 if (rc) {
1947 printk(KERN_WARNING "%s:unable to register hdlc device\n",__FILE__); 1950 printk(KERN_WARNING "%s:unable to register hdlc device\n",__FILE__);
1948 free_netdev(dev); 1951 free_netdev(dev);
1949 return rc; 1952 return rc;
@@ -3920,7 +3923,8 @@ static void synclinkmp_cleanup(void)
3920 printk("Unloading %s %s\n", driver_name, driver_version); 3923 printk("Unloading %s %s\n", driver_name, driver_version);
3921 3924
3922 if (serial_driver) { 3925 if (serial_driver) {
3923 if ((rc = tty_unregister_driver(serial_driver))) 3926 rc = tty_unregister_driver(serial_driver);
3927 if (rc)
3924 printk("%s(%d) failed to unregister tty driver err=%d\n", 3928 printk("%s(%d) failed to unregister tty driver err=%d\n",
3925 __FILE__,__LINE__,rc); 3929 __FILE__,__LINE__,rc);
3926 put_tty_driver(serial_driver); 3930 put_tty_driver(serial_driver);