[openib-general] [PATCH] mthca: cosmetics: use ALIGN macro

Michael S. Tsirkin mst at mellanox.co.il
Thu Jan 12 02:56:31 PST 2006


mthca: cosmetics - use the ALIGN macro

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: linux-2.6.14/drivers/infiniband/hw/mthca/mthca_cmd.c
===================================================================
--- linux-2.6.14.orig/drivers/infiniband/hw/mthca/mthca_cmd.c	2006-01-12 15:38:37.000000000 +0200
+++ linux-2.6.14/drivers/infiniband/hw/mthca/mthca_cmd.c	2006-01-12 15:39:08.000000000 +0200
@@ -727,8 +727,8 @@ int mthca_QUERY_FW(struct mthca_dev *dev
 		 * 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,
@@ -1444,7 +1444,7 @@ int mthca_SET_ICM_SIZE(struct mthca_dev 
 	 * Arbel page size is always 4 KB; round up number of system
 	 * 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;
 }

-- 
MST



More information about the general mailing list