[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51058B3B.3010400@suse.cz>
Date: Sun, 27 Jan 2013 21:16:59 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: Joe Perches <joe@...ches.com>
CC: Dan Carpenter <dan.carpenter@...cle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Paul Fulghum <paulkf@...rogate.com>,
David Howells <dhowells@...hat.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch] TTY: synclink, small cleanup in dtr_rts()
On 01/27/2013 09:04 PM, Joe Perches wrote:
> On Sun, 2013-01-27 at 22:40 +0300, Dan Carpenter wrote:
>> 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.
>
>
> Wouldn't it be clearer still to use | instead of +
Ack, the plus is a mindfuck.
--
js
suse labs
--
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