target uart: remove REG_OFFS() macro side-effect
authorAlex Badea <vamposdecampos@gmail.com>
Wed, 17 Nov 2010 21:35:17 +0000 (23:35 +0200)
committerHarald Welte <laforge@gnumonks.org>
Wed, 17 Nov 2010 22:39:46 +0000 (23:39 +0100)
Don't assign to the variable given as argument.  This prevents
clobbering the local 'reg' variables in uart_reg_{read,write}(),
which would in turn prevent the latch bits from being restored
correctly.

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
src/target/firmware/calypso/uart.c

index 4d7df09..394078d 100644 (file)
@@ -43,7 +43,7 @@
 #define LCR7BIT                0x80
 #define LCRBFBIT       0x40
 #define MCR6BIT                0x20
-#define REG_OFFS(m)    ((m) &= ~(LCR7BIT|LCRBFBIT|MCR6BIT))
+#define REG_OFFS(m)    ((m) & ~(LCR7BIT|LCRBFBIT|MCR6BIT))
 /* read access LCR[7] = 0 */
 enum uart_reg {
        RHR     = 0,