Bluetooth: btmrvl: Use DIV_ROUND_UP macro
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Fri, 28 Sep 2012 11:36:09 +0000 (14:36 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Fri, 28 Sep 2012 15:55:31 +0000 (12:55 -0300)
The kernel.h macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) / (d))

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
drivers/bluetooth/btmrvl_sdio.c

index 645b42e143fa44c35057aa703ced56df7d967ae7..ec5c45672f1df06ebd0dc4d3c728a2e7b84df108 100644 (file)
@@ -514,7 +514,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
        }
 
        blksz = SDIO_BLOCK_SIZE;
-       num_blocks = (buf_len + blksz - 1) / blksz;
+       num_blocks = DIV_ROUND_UP(buf_len, blksz);
 
        if (buf_len <= SDIO_HEADER_LEN
            || (num_blocks * blksz) > ALLOC_BUF_SIZE) {