IB/mthca: Cosmetic: use the ALIGN macro
authorMichael S. Tsirkin <mst@mellanox.co.il>
Thu, 12 Jan 2006 23:43:58 +0000 (15:43 -0800)
committerRoland Dreier <rolandd@cisco.com>
Thu, 12 Jan 2006 23:43:58 +0000 (15:43 -0800)
Use the ALIGN macro to simplify some rounding code.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mthca/mthca_cmd.c

index f69e4896eff000055d76c47df56235379a4b508a..be1791be627bcdd08b03ac7290741f8ae133e26b 100644 (file)
@@ -727,8 +727,8 @@ int mthca_QUERY_FW(struct mthca_dev *dev, u8 *status)
                 * system pages needed.
                 */
                dev->fw.arbel.fw_pages =
-                       (dev->fw.arbel.fw_pages + (1 << (PAGE_SHIFT - 12)) - 1) >>
-                       (PAGE_SHIFT - 12);
+                       ALIGN(dev->fw.arbel.fw_pages, PAGE_SIZE >> 12) >>
+                               (PAGE_SHIFT - 12);
 
                mthca_dbg(dev, "Clear int @ %llx, EQ arm @ %llx, EQ set CI @ %llx\n",
                          (unsigned long long) dev->fw.arbel.clr_int_base,
@@ -1445,6 +1445,7 @@ int mthca_SET_ICM_SIZE(struct mthca_dev *dev, u64 icm_size, u64 *aux_pages,
         * pages needed.
         */
        *aux_pages = (*aux_pages + (1 << (PAGE_SHIFT - 12)) - 1) >> (PAGE_SHIFT - 12);
+       *aux_pages = ALIGN(*aux_pages, PAGE_SIZE >> 12) >> (PAGE_SHIFT - 12);
 
        return 0;
 }