From: Axel Lin Date: Fri, 14 Jun 2013 13:12:19 +0000 (+0800) Subject: spi: cf_qspi: Use DIV_ROUND_UP at appropriate place X-Git-Tag: v2025.01-rc5-pxa1908~16143^2~19 X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=0cb8394f8198f5b420a52b6a6f76c9bf21e68b2e;p=u-boot.git spi: cf_qspi: Use DIV_ROUND_UP at appropriate place This change slightly improves readability. Signed-off-by: Axel Lin Signed-off-by: Richard Retanubun Reviewed-by: Jagannadha Sutradharudu Teki --- diff --git a/drivers/spi/cf_qspi.c b/drivers/spi/cf_qspi.c index a37ac4e526..06bcf91a4a 100644 --- a/drivers/spi/cf_qspi.c +++ b/drivers/spi/cf_qspi.c @@ -171,7 +171,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, volatile qspi_t *qspi = dev->regs; u8 *txbuf = (u8 *)dout; u8 *rxbuf = (u8 *)din; - u32 count = ((bitlen / 8) + (bitlen % 8 ? 1 : 0)); + u32 count = DIV_ROUND_UP(bitlen, 8); u32 n, i = 0; /* Sanitize arguments */