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

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


Quoting r. Michael S. Tsirkin <mst at mellanox.co.il>:
> Subject: [PATCH] mthca: cosmetics: use ALIGN macro
> 
> mthca: cosmetics - use the ALIGN macro
> 
> Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

This patch was mangled. Here's an update, I've put it under
mthca_cosmetic_align.patch.

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 16:54:43.000000000 +0200
+++ linux-2.6.14/drivers/infiniband/hw/mthca/mthca_cmd.c	2006-01-12 16:56:10.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,
@@ -1445,6 +1445,7 @@ int mthca_SET_ICM_SIZE(struct mthca_dev 
 	 * 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