[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0802262144320.18200@ask.diku.dk>
Date: Tue, 26 Feb 2008 21:45:31 +0100 (CET)
From: Julia Lawall <julia@...u.dk>
To: takata@...ux-m32r.org, linux-m32r@...linux-m32r.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH 7/9] drivers/serial/m32r_sio.c: Correct use of ! and &
From: Julia Lawall <julia@...u.dk>
In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337, a bug was fixed that
involved converting !x & y to !(x & y). The code below shows the same
pattern, and thus should perhaps be fixed in the same way.
This is not tested and clearly changes the semantics, so it is only
something to consider.
The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@ expression E1,E2; @@
(
!E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)
// </smpl>
Signed-off-by: Julia Lawall <julia@...u.dk>
---
diff -u -p a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c
--- a/drivers/serial/m32r_sio.c 2007-10-22 11:25:24.000000000 +0200
+++ b/drivers/serial/m32r_sio.c 2008-02-26 08:12:18.000000000 +0100
@@ -421,7 +421,7 @@ static void transmit_chars(struct uart_s
up->port.icount.tx++;
if (uart_circ_empty(xmit))
break;
- while (!serial_in(up, UART_LSR) & UART_LSR_THRE);
+ while (!(serial_in(up, UART_LSR) & UART_LSR_THRE));
} while (--count > 0);
--
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