]> git.karo-electronics.de Git - linux-beck.git/commitdiff
serial: imx: Add braces to avoid ambiguous 'else'
authorFabio Estevam <fabio.estevam@freescale.com>
Tue, 10 Mar 2015 15:46:29 +0000 (12:46 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Mar 2015 12:55:20 +0000 (13:55 +0100)
Commit 17b8f2a3fdca29 ("serial: imx: add support for half duplex rs485")
introduced the following build warning:

drivers/tty/serial/imx.c: In function 'imx_set_termios':
drivers/tty/serial/imx.c:1301:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]

Add the suggested braces to avoid the build warning.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index ddfb672d01528992b3d89350f61b7763f065a58e..c8cfa06371280af6abfd63bd379ee5c121523ad7 100644 (file)
@@ -1298,7 +1298,7 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
                if (sport->have_rtscts) {
                        ucr2 &= ~UCR2_IRTS;
 
-                       if (port->rs485.flags & SER_RS485_ENABLED)
+                       if (port->rs485.flags & SER_RS485_ENABLED) {
                                /*
                                 * RTS is mandatory for rs485 operation, so keep
                                 * it under manual control and keep transmitter
@@ -1307,9 +1307,9 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
                                if (!(port->rs485.flags &
                                      SER_RS485_RTS_AFTER_SEND))
                                        ucr2 |= UCR2_CTS;
-                       else
+                       } else {
                                ucr2 |= UCR2_CTSC;
-
+                       }
                } else {
                        termios->c_cflag &= ~CRTSCTS;
                }