Bluetooth: use DIV_ROUND_UP in suitable places in btmrvl_sdio
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 2 Aug 2013 11:10:12 +0000 (14:10 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 21 Aug 2013 14:46:50 +0000 (16:46 +0200)
There are two places where DIV_ROUND_UP may be used. It makes code a bit
clearer.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
drivers/bluetooth/btmrvl_sdio.c

index 75c262694632255e0932fa387c7e6b9d6e08aa25..00da6df9f71edfcd6f92acbe70129af5ec62e0bf 100644 (file)
@@ -486,7 +486,7 @@ static int btmrvl_sdio_download_fw_w_helper(struct btmrvl_sdio_card *card)
                        if (firmwarelen - offset < txlen)
                                txlen = firmwarelen - offset;
 
-                       tx_blocks = (txlen + blksz_dl - 1) / blksz_dl;
+                       tx_blocks = DIV_ROUND_UP(txlen, blksz_dl);
 
                        memcpy(fwbuf, &firmware[offset], txlen);
                }
@@ -873,7 +873,7 @@ static int btmrvl_sdio_host_to_card(struct btmrvl_private *priv,
        }
 
        blksz = SDIO_BLOCK_SIZE;
-       buf_block_len = (nb + blksz - 1) / blksz;
+       buf_block_len = DIV_ROUND_UP(nb, blksz);
 
        sdio_claim_host(card->func);