diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-29 16:24:28 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-29 16:24:28 +0200 |
| commit | 24b1c251dfcd02877c40d7e52288c9bc2dc7ff35 (patch) | |
| tree | 8fb3d4332168686f601f58b23815910799b1699f /0013-synclinkmp.c-move-assignment-out-of-if-block.patch | |
| parent | 71c7e32cd1509d46be836ed19dfe63e217eae8d4 (diff) | |
| download | patches-24b1c251dfcd02877c40d7e52288c9bc2dc7ff35.tar.gz | |
updates and new patches
Diffstat (limited to '0013-synclinkmp.c-move-assignment-out-of-if-block.patch')
| -rw-r--r-- | 0013-synclinkmp.c-move-assignment-out-of-if-block.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/0013-synclinkmp.c-move-assignment-out-of-if-block.patch b/0013-synclinkmp.c-move-assignment-out-of-if-block.patch new file mode 100644 index 00000000000000..2eec77bcdaffc2 --- /dev/null +++ b/0013-synclinkmp.c-move-assignment-out-of-if-block.patch @@ -0,0 +1,63 @@ +From 81823a3d3e8062b6556db720bac0d3ab15b5b81e Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Date: Wed, 29 Apr 2015 16:22:08 +0200 +Subject: [PATCH 13/36] 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> +--- + drivers/tty/synclinkmp.c | 12 ++++++++---- + 1 file 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) + printk("%s:hdlcdev_open(%s)\n",__FILE__,dev->name); + + /* generic HDLC layer open processing */ +- if ((rc = hdlc_open(dev))) ++ rc = hdlc_open(dev); ++ if (rc) + return rc; + + /* arbitrate between network and tty opens */ +@@ -1922,7 +1923,8 @@ static int hdlcdev_init(SLMP_INFO *info) + + /* allocate and initialize network and HDLC layer objects */ + +- if (!(dev = alloc_hdlcdev(info))) { ++ dev = alloc_hdlcdev(info); ++ if (!dev) { + printk(KERN_ERR "%s:hdlc device allocation failure\n",__FILE__); + return -ENOMEM; + } +@@ -1943,7 +1945,8 @@ static int hdlcdev_init(SLMP_INFO *info) + hdlc->xmit = hdlcdev_xmit; + + /* register objects with HDLC layer */ +- if ((rc = register_hdlc_device(dev))) { ++ rc = register_hdlc_device(dev); ++ if (rc) { + printk(KERN_WARNING "%s:unable to register hdlc device\n",__FILE__); + free_netdev(dev); + return rc; +@@ -3920,7 +3923,8 @@ static void synclinkmp_cleanup(void) + printk("Unloading %s %s\n", driver_name, driver_version); + + if (serial_driver) { +- if ((rc = tty_unregister_driver(serial_driver))) ++ rc = tty_unregister_driver(serial_driver); ++ if (rc) + printk("%s(%d) failed to unregister tty driver err=%d\n", + __FILE__,__LINE__,rc); + put_tty_driver(serial_driver); +-- +2.3.7 + |
