sacsng board: fix warnings "suggest explicit braces to avoid ambiguous 'else'"
authorWolfgang Denk <wd@denx.de>
Thu, 3 Jul 2008 20:39:21 +0000 (22:39 +0200)
committerWolfgang Denk <wd@denx.de>
Thu, 3 Jul 2008 20:39:21 +0000 (22:39 +0200)
Signed-off-by: Wolfgang Denk <wd@denx.de>
include/configs/sacsng.h

index 4974fb43f72b293a84179ff45c02e7354f25310f..2a398e8c45c67fb8bb95b413899ca441700222d8 100644 (file)
 
 #undef  SPI_INIT                       /* no port initialization needed */
 #define SPI_READ        ((immr->im_ioport.iop_pdatd & I2C_MISO) != 0)
-#define SPI_SDA(bit)    if(bit) immr->im_ioport.iop_pdatd |=  I2C_MOSI; \
-                       else    immr->im_ioport.iop_pdatd &= ~I2C_MOSI
-#define SPI_SCL(bit)    if(bit) immr->im_ioport.iop_pdatd |=  I2C_SCLK; \
-                       else    immr->im_ioport.iop_pdatd &= ~I2C_SCLK
+#define SPI_SDA(bit)    do {                                           \
+                       if(bit) immr->im_ioport.iop_pdatd |=  I2C_MOSI; \
+                       else    immr->im_ioport.iop_pdatd &= ~I2C_MOSI; \
+                       } while (0)
+#define SPI_SCL(bit)    do {                                           \
+                       if(bit) immr->im_ioport.iop_pdatd |=  I2C_SCLK; \
+                       else    immr->im_ioport.iop_pdatd &= ~I2C_SCLK; \
+                       } while (0)
 #define SPI_DELAY                       /* No delay is needed */
 #endif /* CONFIG_SOFT_SPI */