From: Wolfgang Denk Date: Thu, 3 Jul 2008 20:39:21 +0000 (+0200) Subject: sacsng board: fix warnings "suggest explicit braces to avoid ambiguous 'else'" X-Git-Tag: v1.3.4-rc1~90^2~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ced209c50e80c25f13c083099b05044048d21f4f;p=u-boot sacsng board: fix warnings "suggest explicit braces to avoid ambiguous 'else'" Signed-off-by: Wolfgang Denk --- diff --git a/include/configs/sacsng.h b/include/configs/sacsng.h index 4974fb43f7..2a398e8c45 100644 --- a/include/configs/sacsng.h +++ b/include/configs/sacsng.h @@ -272,10 +272,14 @@ #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 */