diff options
author | Joe Perches <joe@perches.com> | 2013-01-27 21:21:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-30 00:09:58 -0500 |
commit | 9fe8074b82ed14358be50c62ab9d081bcb911607 (patch) | |
tree | 53dd1345c50b76426747536bb681489f59aaa93f /drivers | |
parent | abd7bacae672298ec99ce6cfdc75ae1e1f9159b6 (diff) |
TTY: synclink: Convert + to | for bit operations
Dan Carpenter noticed a missing set of parentheses
around a multiple field addition.
https://lkml.org/lkml/2013/1/27/166
His original commit message:
There is a kind of precedence problem here, but it doesn't affect how
the code works because ->serial_signals is unsigned char. We want to
clear two flags here.
#define SerialSignal_RTS 0x20 /* Request to Send */
#define SerialSignal_DTR 0x80 /* Data Terminal Ready */
Without the parenthesis then it does:
info->serial_signals &= 0x5f;
With the parenthesis it does:
info->serial_signals &= 0xffffff5f;
info->serial_signals is an unsigned char so the two statements are
equivalent, but it's cleaner to add the parenthesis. In other dtr_rts()
functions the parenthesis are there so this makes it more consistent.
Other changes:
Convert all + uses to | for these bit operations.
Reorder the multiple fields for consistency.
Update the comments too.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 26 | ||||
-rw-r--r-- | drivers/tty/synclink.c | 26 | ||||
-rw-r--r-- | drivers/tty/synclink_gt.c | 26 | ||||
-rw-r--r-- | drivers/tty/synclinkmp.c | 40 |
4 files changed, 59 insertions, 59 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 34e52ed0ea8c..d0c9852ab875 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -1343,7 +1343,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty) | |||
1343 | reset_device(info); | 1343 | reset_device(info); |
1344 | 1344 | ||
1345 | if (!tty || tty->termios.c_cflag & HUPCL) { | 1345 | if (!tty || tty->termios.c_cflag & HUPCL) { |
1346 | info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS); | 1346 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
1347 | set_signals(info); | 1347 | set_signals(info); |
1348 | } | 1348 | } |
1349 | 1349 | ||
@@ -1405,12 +1405,12 @@ static void mgslpc_change_params(MGSLPC_INFO *info, struct tty_struct *tty) | |||
1405 | 1405 | ||
1406 | cflag = tty->termios.c_cflag; | 1406 | cflag = tty->termios.c_cflag; |
1407 | 1407 | ||
1408 | /* if B0 rate (hangup) specified then negate DTR and RTS */ | 1408 | /* if B0 rate (hangup) specified then negate RTS and DTR */ |
1409 | /* otherwise assert DTR and RTS */ | 1409 | /* otherwise assert RTS and DTR */ |
1410 | if (cflag & CBAUD) | 1410 | if (cflag & CBAUD) |
1411 | info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; | 1411 | info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; |
1412 | else | 1412 | else |
1413 | info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 1413 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
1414 | 1414 | ||
1415 | /* byte size and parity */ | 1415 | /* byte size and parity */ |
1416 | 1416 | ||
@@ -2301,7 +2301,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term | |||
2301 | /* Handle transition to B0 status */ | 2301 | /* Handle transition to B0 status */ |
2302 | if (old_termios->c_cflag & CBAUD && | 2302 | if (old_termios->c_cflag & CBAUD && |
2303 | !(tty->termios.c_cflag & CBAUD)) { | 2303 | !(tty->termios.c_cflag & CBAUD)) { |
2304 | info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 2304 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
2305 | spin_lock_irqsave(&info->lock,flags); | 2305 | spin_lock_irqsave(&info->lock,flags); |
2306 | set_signals(info); | 2306 | set_signals(info); |
2307 | spin_unlock_irqrestore(&info->lock,flags); | 2307 | spin_unlock_irqrestore(&info->lock,flags); |
@@ -2464,9 +2464,9 @@ static void dtr_rts(struct tty_port *port, int onoff) | |||
2464 | 2464 | ||
2465 | spin_lock_irqsave(&info->lock,flags); | 2465 | spin_lock_irqsave(&info->lock,flags); |
2466 | if (onoff) | 2466 | if (onoff) |
2467 | info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; | 2467 | info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; |
2468 | else | 2468 | else |
2469 | info->serial_signals &= ~SerialSignal_RTS + SerialSignal_DTR; | 2469 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
2470 | set_signals(info); | 2470 | set_signals(info); |
2471 | spin_unlock_irqrestore(&info->lock,flags); | 2471 | spin_unlock_irqrestore(&info->lock,flags); |
2472 | } | 2472 | } |
@@ -3575,8 +3575,8 @@ static void get_signals(MGSLPC_INFO *info) | |||
3575 | { | 3575 | { |
3576 | unsigned char status = 0; | 3576 | unsigned char status = 0; |
3577 | 3577 | ||
3578 | /* preserve DTR and RTS */ | 3578 | /* preserve RTS and DTR */ |
3579 | info->serial_signals &= SerialSignal_DTR + SerialSignal_RTS; | 3579 | info->serial_signals &= SerialSignal_RTS | SerialSignal_DTR; |
3580 | 3580 | ||
3581 | if (read_reg(info, CHB + VSTR) & BIT7) | 3581 | if (read_reg(info, CHB + VSTR) & BIT7) |
3582 | info->serial_signals |= SerialSignal_DCD; | 3582 | info->serial_signals |= SerialSignal_DCD; |
@@ -3590,7 +3590,7 @@ static void get_signals(MGSLPC_INFO *info) | |||
3590 | info->serial_signals |= SerialSignal_DSR; | 3590 | info->serial_signals |= SerialSignal_DSR; |
3591 | } | 3591 | } |
3592 | 3592 | ||
3593 | /* Set the state of DTR and RTS based on contents of | 3593 | /* Set the state of RTS and DTR based on contents of |
3594 | * serial_signals member of device extension. | 3594 | * serial_signals member of device extension. |
3595 | */ | 3595 | */ |
3596 | static void set_signals(MGSLPC_INFO *info) | 3596 | static void set_signals(MGSLPC_INFO *info) |
@@ -4009,8 +4009,8 @@ static int hdlcdev_open(struct net_device *dev) | |||
4009 | spin_unlock_irqrestore(&info->netlock, flags); | 4009 | spin_unlock_irqrestore(&info->netlock, flags); |
4010 | return rc; | 4010 | return rc; |
4011 | } | 4011 | } |
4012 | /* assert DTR and RTS, apply hardware settings */ | 4012 | /* assert RTS and DTR, apply hardware settings */ |
4013 | info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; | 4013 | info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; |
4014 | mgslpc_program_hw(info, tty); | 4014 | mgslpc_program_hw(info, tty); |
4015 | tty_kref_put(tty); | 4015 | tty_kref_put(tty); |
4016 | 4016 | ||
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c index 555fdc0ed0f1..8983276aa35e 100644 --- a/drivers/tty/synclink.c +++ b/drivers/tty/synclink.c | |||
@@ -1850,7 +1850,7 @@ static void shutdown(struct mgsl_struct * info) | |||
1850 | usc_OutReg(info, PCR, (u16)((usc_InReg(info, PCR) | BIT13) | BIT12)); | 1850 | usc_OutReg(info, PCR, (u16)((usc_InReg(info, PCR) | BIT13) | BIT12)); |
1851 | 1851 | ||
1852 | if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { | 1852 | if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { |
1853 | info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS); | 1853 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
1854 | usc_set_serial_signals(info); | 1854 | usc_set_serial_signals(info); |
1855 | } | 1855 | } |
1856 | 1856 | ||
@@ -1915,12 +1915,12 @@ static void mgsl_change_params(struct mgsl_struct *info) | |||
1915 | 1915 | ||
1916 | cflag = info->port.tty->termios.c_cflag; | 1916 | cflag = info->port.tty->termios.c_cflag; |
1917 | 1917 | ||
1918 | /* if B0 rate (hangup) specified then negate DTR and RTS */ | 1918 | /* if B0 rate (hangup) specified then negate RTS and DTR */ |
1919 | /* otherwise assert DTR and RTS */ | 1919 | /* otherwise assert RTS and DTR */ |
1920 | if (cflag & CBAUD) | 1920 | if (cflag & CBAUD) |
1921 | info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; | 1921 | info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; |
1922 | else | 1922 | else |
1923 | info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 1923 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
1924 | 1924 | ||
1925 | /* byte size and parity */ | 1925 | /* byte size and parity */ |
1926 | 1926 | ||
@@ -3044,7 +3044,7 @@ static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termio | |||
3044 | /* Handle transition to B0 status */ | 3044 | /* Handle transition to B0 status */ |
3045 | if (old_termios->c_cflag & CBAUD && | 3045 | if (old_termios->c_cflag & CBAUD && |
3046 | !(tty->termios.c_cflag & CBAUD)) { | 3046 | !(tty->termios.c_cflag & CBAUD)) { |
3047 | info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 3047 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
3048 | spin_lock_irqsave(&info->irq_spinlock,flags); | 3048 | spin_lock_irqsave(&info->irq_spinlock,flags); |
3049 | usc_set_serial_signals(info); | 3049 | usc_set_serial_signals(info); |
3050 | spin_unlock_irqrestore(&info->irq_spinlock,flags); | 3050 | spin_unlock_irqrestore(&info->irq_spinlock,flags); |
@@ -3243,9 +3243,9 @@ static void dtr_rts(struct tty_port *port, int on) | |||
3243 | 3243 | ||
3244 | spin_lock_irqsave(&info->irq_spinlock,flags); | 3244 | spin_lock_irqsave(&info->irq_spinlock,flags); |
3245 | if (on) | 3245 | if (on) |
3246 | info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; | 3246 | info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; |
3247 | else | 3247 | else |
3248 | info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 3248 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
3249 | usc_set_serial_signals(info); | 3249 | usc_set_serial_signals(info); |
3250 | spin_unlock_irqrestore(&info->irq_spinlock,flags); | 3250 | spin_unlock_irqrestore(&info->irq_spinlock,flags); |
3251 | } | 3251 | } |
@@ -6239,8 +6239,8 @@ static void usc_get_serial_signals( struct mgsl_struct *info ) | |||
6239 | { | 6239 | { |
6240 | u16 status; | 6240 | u16 status; |
6241 | 6241 | ||
6242 | /* clear all serial signals except DTR and RTS */ | 6242 | /* clear all serial signals except RTS and DTR */ |
6243 | info->serial_signals &= SerialSignal_DTR + SerialSignal_RTS; | 6243 | info->serial_signals &= SerialSignal_RTS | SerialSignal_DTR; |
6244 | 6244 | ||
6245 | /* Read the Misc Interrupt status Register (MISR) to get */ | 6245 | /* Read the Misc Interrupt status Register (MISR) to get */ |
6246 | /* the V24 status signals. */ | 6246 | /* the V24 status signals. */ |
@@ -6265,7 +6265,7 @@ static void usc_get_serial_signals( struct mgsl_struct *info ) | |||
6265 | 6265 | ||
6266 | /* usc_set_serial_signals() | 6266 | /* usc_set_serial_signals() |
6267 | * | 6267 | * |
6268 | * Set the state of DTR and RTS based on contents of | 6268 | * Set the state of RTS and DTR based on contents of |
6269 | * serial_signals member of device extension. | 6269 | * serial_signals member of device extension. |
6270 | * | 6270 | * |
6271 | * Arguments: info pointer to device instance data | 6271 | * Arguments: info pointer to device instance data |
@@ -7779,8 +7779,8 @@ static int hdlcdev_open(struct net_device *dev) | |||
7779 | return rc; | 7779 | return rc; |
7780 | } | 7780 | } |
7781 | 7781 | ||
7782 | /* assert DTR and RTS, apply hardware settings */ | 7782 | /* assert RTS and DTR, apply hardware settings */ |
7783 | info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; | 7783 | info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; |
7784 | mgsl_program_hw(info); | 7784 | mgsl_program_hw(info); |
7785 | 7785 | ||
7786 | /* enable network layer transmit */ | 7786 | /* enable network layer transmit */ |
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index ac8599a76820..aa9eece35c3b 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c | |||
@@ -785,7 +785,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
785 | /* Handle transition to B0 status */ | 785 | /* Handle transition to B0 status */ |
786 | if (old_termios->c_cflag & CBAUD && | 786 | if (old_termios->c_cflag & CBAUD && |
787 | !(tty->termios.c_cflag & CBAUD)) { | 787 | !(tty->termios.c_cflag & CBAUD)) { |
788 | info->signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 788 | info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
789 | spin_lock_irqsave(&info->lock,flags); | 789 | spin_lock_irqsave(&info->lock,flags); |
790 | set_signals(info); | 790 | set_signals(info); |
791 | spin_unlock_irqrestore(&info->lock,flags); | 791 | spin_unlock_irqrestore(&info->lock,flags); |
@@ -1560,8 +1560,8 @@ static int hdlcdev_open(struct net_device *dev) | |||
1560 | return rc; | 1560 | return rc; |
1561 | } | 1561 | } |
1562 | 1562 | ||
1563 | /* assert DTR and RTS, apply hardware settings */ | 1563 | /* assert RTS and DTR, apply hardware settings */ |
1564 | info->signals |= SerialSignal_RTS + SerialSignal_DTR; | 1564 | info->signals |= SerialSignal_RTS | SerialSignal_DTR; |
1565 | program_hw(info); | 1565 | program_hw(info); |
1566 | 1566 | ||
1567 | /* enable network layer transmit */ | 1567 | /* enable network layer transmit */ |
@@ -2488,7 +2488,7 @@ static void shutdown(struct slgt_info *info) | |||
2488 | slgt_irq_off(info, IRQ_ALL | IRQ_MASTER); | 2488 | slgt_irq_off(info, IRQ_ALL | IRQ_MASTER); |
2489 | 2489 | ||
2490 | if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { | 2490 | if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { |
2491 | info->signals &= ~(SerialSignal_DTR + SerialSignal_RTS); | 2491 | info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
2492 | set_signals(info); | 2492 | set_signals(info); |
2493 | } | 2493 | } |
2494 | 2494 | ||
@@ -2548,12 +2548,12 @@ static void change_params(struct slgt_info *info) | |||
2548 | 2548 | ||
2549 | cflag = info->port.tty->termios.c_cflag; | 2549 | cflag = info->port.tty->termios.c_cflag; |
2550 | 2550 | ||
2551 | /* if B0 rate (hangup) specified then negate DTR and RTS */ | 2551 | /* if B0 rate (hangup) specified then negate RTS and DTR */ |
2552 | /* otherwise assert DTR and RTS */ | 2552 | /* otherwise assert RTS and DTR */ |
2553 | if (cflag & CBAUD) | 2553 | if (cflag & CBAUD) |
2554 | info->signals |= SerialSignal_RTS + SerialSignal_DTR; | 2554 | info->signals |= SerialSignal_RTS | SerialSignal_DTR; |
2555 | else | 2555 | else |
2556 | info->signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 2556 | info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
2557 | 2557 | ||
2558 | /* byte size and parity */ | 2558 | /* byte size and parity */ |
2559 | 2559 | ||
@@ -3256,9 +3256,9 @@ static void dtr_rts(struct tty_port *port, int on) | |||
3256 | 3256 | ||
3257 | spin_lock_irqsave(&info->lock,flags); | 3257 | spin_lock_irqsave(&info->lock,flags); |
3258 | if (on) | 3258 | if (on) |
3259 | info->signals |= SerialSignal_RTS + SerialSignal_DTR; | 3259 | info->signals |= SerialSignal_RTS | SerialSignal_DTR; |
3260 | else | 3260 | else |
3261 | info->signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 3261 | info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
3262 | set_signals(info); | 3262 | set_signals(info); |
3263 | spin_unlock_irqrestore(&info->lock,flags); | 3263 | spin_unlock_irqrestore(&info->lock,flags); |
3264 | } | 3264 | } |
@@ -4119,7 +4119,7 @@ static void reset_port(struct slgt_info *info) | |||
4119 | tx_stop(info); | 4119 | tx_stop(info); |
4120 | rx_stop(info); | 4120 | rx_stop(info); |
4121 | 4121 | ||
4122 | info->signals &= ~(SerialSignal_DTR + SerialSignal_RTS); | 4122 | info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
4123 | set_signals(info); | 4123 | set_signals(info); |
4124 | 4124 | ||
4125 | slgt_irq_off(info, IRQ_ALL | IRQ_MASTER); | 4125 | slgt_irq_off(info, IRQ_ALL | IRQ_MASTER); |
@@ -4546,8 +4546,8 @@ static void get_signals(struct slgt_info *info) | |||
4546 | { | 4546 | { |
4547 | unsigned short status = rd_reg16(info, SSR); | 4547 | unsigned short status = rd_reg16(info, SSR); |
4548 | 4548 | ||
4549 | /* clear all serial signals except DTR and RTS */ | 4549 | /* clear all serial signals except RTS and DTR */ |
4550 | info->signals &= SerialSignal_DTR + SerialSignal_RTS; | 4550 | info->signals &= SerialSignal_RTS | SerialSignal_DTR; |
4551 | 4551 | ||
4552 | if (status & BIT3) | 4552 | if (status & BIT3) |
4553 | info->signals |= SerialSignal_DSR; | 4553 | info->signals |= SerialSignal_DSR; |
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c index 545402509cab..6d5780cf1d57 100644 --- a/drivers/tty/synclinkmp.c +++ b/drivers/tty/synclinkmp.c | |||
@@ -882,7 +882,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
882 | /* Handle transition to B0 status */ | 882 | /* Handle transition to B0 status */ |
883 | if (old_termios->c_cflag & CBAUD && | 883 | if (old_termios->c_cflag & CBAUD && |
884 | !(tty->termios.c_cflag & CBAUD)) { | 884 | !(tty->termios.c_cflag & CBAUD)) { |
885 | info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 885 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
886 | spin_lock_irqsave(&info->lock,flags); | 886 | spin_lock_irqsave(&info->lock,flags); |
887 | set_signals(info); | 887 | set_signals(info); |
888 | spin_unlock_irqrestore(&info->lock,flags); | 888 | spin_unlock_irqrestore(&info->lock,flags); |
@@ -1676,8 +1676,8 @@ static int hdlcdev_open(struct net_device *dev) | |||
1676 | return rc; | 1676 | return rc; |
1677 | } | 1677 | } |
1678 | 1678 | ||
1679 | /* assert DTR and RTS, apply hardware settings */ | 1679 | /* assert RTS and DTR, apply hardware settings */ |
1680 | info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; | 1680 | info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; |
1681 | program_hw(info); | 1681 | program_hw(info); |
1682 | 1682 | ||
1683 | /* enable network layer transmit */ | 1683 | /* enable network layer transmit */ |
@@ -2706,7 +2706,7 @@ static void shutdown(SLMP_INFO * info) | |||
2706 | reset_port(info); | 2706 | reset_port(info); |
2707 | 2707 | ||
2708 | if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { | 2708 | if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { |
2709 | info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS); | 2709 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
2710 | set_signals(info); | 2710 | set_signals(info); |
2711 | } | 2711 | } |
2712 | 2712 | ||
@@ -2768,12 +2768,12 @@ static void change_params(SLMP_INFO *info) | |||
2768 | 2768 | ||
2769 | cflag = info->port.tty->termios.c_cflag; | 2769 | cflag = info->port.tty->termios.c_cflag; |
2770 | 2770 | ||
2771 | /* if B0 rate (hangup) specified then negate DTR and RTS */ | 2771 | /* if B0 rate (hangup) specified then negate RTS and DTR */ |
2772 | /* otherwise assert DTR and RTS */ | 2772 | /* otherwise assert RTS and DTR */ |
2773 | if (cflag & CBAUD) | 2773 | if (cflag & CBAUD) |
2774 | info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; | 2774 | info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; |
2775 | else | 2775 | else |
2776 | info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 2776 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
2777 | 2777 | ||
2778 | /* byte size and parity */ | 2778 | /* byte size and parity */ |
2779 | 2779 | ||
@@ -3212,12 +3212,12 @@ static int tiocmget(struct tty_struct *tty) | |||
3212 | get_signals(info); | 3212 | get_signals(info); |
3213 | spin_unlock_irqrestore(&info->lock,flags); | 3213 | spin_unlock_irqrestore(&info->lock,flags); |
3214 | 3214 | ||
3215 | result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS:0) + | 3215 | result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS : 0) | |
3216 | ((info->serial_signals & SerialSignal_DTR) ? TIOCM_DTR:0) + | 3216 | ((info->serial_signals & SerialSignal_DTR) ? TIOCM_DTR : 0) | |
3217 | ((info->serial_signals & SerialSignal_DCD) ? TIOCM_CAR:0) + | 3217 | ((info->serial_signals & SerialSignal_DCD) ? TIOCM_CAR : 0) | |
3218 | ((info->serial_signals & SerialSignal_RI) ? TIOCM_RNG:0) + | 3218 | ((info->serial_signals & SerialSignal_RI) ? TIOCM_RNG : 0) | |
3219 | ((info->serial_signals & SerialSignal_DSR) ? TIOCM_DSR:0) + | 3219 | ((info->serial_signals & SerialSignal_DSR) ? TIOCM_DSR : 0) | |
3220 | ((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS:0); | 3220 | ((info->serial_signals & SerialSignal_CTS) ? TIOCM_CTS : 0); |
3221 | 3221 | ||
3222 | if (debug_level >= DEBUG_LEVEL_INFO) | 3222 | if (debug_level >= DEBUG_LEVEL_INFO) |
3223 | printk("%s(%d):%s tiocmget() value=%08X\n", | 3223 | printk("%s(%d):%s tiocmget() value=%08X\n", |
@@ -3272,9 +3272,9 @@ static void dtr_rts(struct tty_port *port, int on) | |||
3272 | 3272 | ||
3273 | spin_lock_irqsave(&info->lock,flags); | 3273 | spin_lock_irqsave(&info->lock,flags); |
3274 | if (on) | 3274 | if (on) |
3275 | info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR; | 3275 | info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; |
3276 | else | 3276 | else |
3277 | info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR); | 3277 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
3278 | set_signals(info); | 3278 | set_signals(info); |
3279 | spin_unlock_irqrestore(&info->lock,flags); | 3279 | spin_unlock_irqrestore(&info->lock,flags); |
3280 | } | 3280 | } |
@@ -4354,7 +4354,7 @@ static void reset_port(SLMP_INFO *info) | |||
4354 | tx_stop(info); | 4354 | tx_stop(info); |
4355 | rx_stop(info); | 4355 | rx_stop(info); |
4356 | 4356 | ||
4357 | info->serial_signals &= ~(SerialSignal_DTR + SerialSignal_RTS); | 4357 | info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); |
4358 | set_signals(info); | 4358 | set_signals(info); |
4359 | 4359 | ||
4360 | /* disable all port interrupts */ | 4360 | /* disable all port interrupts */ |
@@ -4750,8 +4750,8 @@ static void get_signals(SLMP_INFO *info) | |||
4750 | u16 gpstatus = read_status_reg(info); | 4750 | u16 gpstatus = read_status_reg(info); |
4751 | u16 testbit; | 4751 | u16 testbit; |
4752 | 4752 | ||
4753 | /* clear all serial signals except DTR and RTS */ | 4753 | /* clear all serial signals except RTS and DTR */ |
4754 | info->serial_signals &= SerialSignal_DTR + SerialSignal_RTS; | 4754 | info->serial_signals &= SerialSignal_RTS | SerialSignal_DTR; |
4755 | 4755 | ||
4756 | /* set serial signal bits to reflect MISR */ | 4756 | /* set serial signal bits to reflect MISR */ |
4757 | 4757 | ||
@@ -4770,7 +4770,7 @@ static void get_signals(SLMP_INFO *info) | |||
4770 | info->serial_signals |= SerialSignal_DSR; | 4770 | info->serial_signals |= SerialSignal_DSR; |
4771 | } | 4771 | } |
4772 | 4772 | ||
4773 | /* Set the state of DTR and RTS based on contents of | 4773 | /* Set the state of RTS and DTR based on contents of |
4774 | * serial_signals member of device context. | 4774 | * serial_signals member of device context. |
4775 | */ | 4775 | */ |
4776 | static void set_signals(SLMP_INFO *info) | 4776 | static void set_signals(SLMP_INFO *info) |