[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130127194039.GA18787@elgon.mountain>
Date: Sun, 27 Jan 2013 22:40:40 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jiri Slaby <jslaby@...e.cz>, Paul Fulghum <paulkf@...rogate.com>,
David Howells <dhowells@...hat.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] TTY: synclink, small cleanup in dtr_rts()
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@...cle.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);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists