linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] TTY: synclink, small cleanup in dtr_rts()
@ 2013-01-27 19:40 Dan Carpenter
  2013-01-27 20:04 ` Joe Perches
  0 siblings, 1 reply; 23+ messages in thread
From: Dan Carpenter @ 2013-01-27 19:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Paul Fulghum, David Howells, linux-kernel, kernel-janitors

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 34e52ed..749fc05 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -2466,7 +2466,7 @@ static void dtr_rts(struct tty_port *port, int onoff)
 	if (onoff)
 		info->serial_signals |= SerialSignal_RTS + SerialSignal_DTR;
 	else
-		info->serial_signals &= ~SerialSignal_RTS + SerialSignal_DTR;
+		info->serial_signals &= ~(SerialSignal_RTS + SerialSignal_DTR);
 	set_signals(info);
 	spin_unlock_irqrestore(&info->lock,flags);
 }

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-01-30 18:25 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-27 19:40 [patch] TTY: synclink, small cleanup in dtr_rts() Dan Carpenter
2013-01-27 20:04 ` Joe Perches
2013-01-27 20:16   ` Jiri Slaby
2013-01-27 20:19   ` Dan Carpenter
2013-01-27 21:00     ` Joe Perches
     [not found]       ` <C8AFB2C4-4974-4265-A41C-A56C71784F39@microgate.com>
2013-01-28  2:21         ` [PATCH] TTY: synclink: Convert + to | for bit operations Joe Perches
2013-01-28 12:06       ` [patch] TTY: synclink, small cleanup in dtr_rts() walter harms
2013-01-29 15:55     ` Valdis.Kletnieks
2013-01-29 16:13       ` coccinelle and bitmask arithmetic (was: Re: [patch] TTY: synclink, small cleanup in dtr_rts()) Joe Perches
2013-01-29 16:19         ` Julia Lawall
2013-01-29 16:31           ` Joe Perches
2013-01-29 17:30           ` Dan Carpenter
2013-01-29 17:42             ` Dan Carpenter
2013-01-29 17:49         ` Julia Lawall
2013-01-29 18:03           ` Joe Perches
2013-01-30  8:21             ` coccinelle and bitmask arithmetic walter harms
2013-01-30  8:29               ` Joe Perches
2013-01-30 11:14               ` Russell King - ARM Linux
2013-01-30 11:21                 ` Julia Lawall
2013-01-30 11:35                   ` Russell King - ARM Linux
2013-01-30 16:53                     ` Joe Perches
2013-01-30 18:23                       ` Russell King - ARM Linux
2013-01-29 18:38         ` coccinelle and bitmask arithmetic (was: Re: [patch] TTY: synclink, small cleanup in dtr_rts()) Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).