From e91d2352bb6ebd061b362b3c632ec517ac0c23b1 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 30 Aug 2013 11:00:23 +0800 Subject: spi: tegra: Use DIV_ROUND_UP instead of open coded This also makes the intention more clear. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- drivers/spi/spi-tegra20-slink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/spi/spi-tegra20-slink.c') diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index c70353672a23..231b84523d37 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c @@ -283,7 +283,7 @@ static unsigned tegra_slink_calculate_curr_xfer_param( unsigned total_fifo_words; bits_per_word = t->bits_per_word; - tspi->bytes_per_word = (bits_per_word - 1) / 8 + 1; + tspi->bytes_per_word = DIV_ROUND_UP(bits_per_word, 8); if (bits_per_word == 8 || bits_per_word == 16) { tspi->is_packed = 1; -- cgit v1.2.3