Skip to contentSkip to conversation

habanalabs: Fix test build failures

PATCH Superseded Guenter Roeck 1 participant 1 message Apr 1, 2022 Char and misc drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 habanalabs: Fix test build failures

allmodconfig builds on 32-bit architectures fail with the following error.

drivers/misc/habanalabs/common/memory.c: In function 'alloc_device_memory':
drivers/misc/habanalabs/common/memory.c:153:49: error:
cast from pointer to integer of different size

Add the missing typecast.

Fixes e8458e20e0a3c ("habanalabs: make sure device mem alloc is page aligned")
Cc Ohad Sharabi <[email protected]>

---
Resend: Sorry, forgot to copy mailing list

 drivers/misc/habanalabs/common/memory.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/misc/habanalabs/common/memory.c +3 -3
index e008d82e4ba3..f0d373171d2a 100644
@@ -150,9 +150,9 @@ static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args,
 		for (i = 0 ; i < num_pgs ; i++) {
 			if (is_power_of_2(page_size))
 				phys_pg_pack->pages[i] =
-						(u64) gen_pool_dma_alloc_align(vm->dram_pg_pool,
-										page_size, NULL,
-										page_size);
+					(u64)(uintptr_t)gen_pool_dma_alloc_align(vm->dram_pg_pool,
+										 page_size, NULL,
+										 page_size);
 			else
 				phys_pg_pack->pages[i] = (u64) gen_pool_alloc(vm->dram_pg_pool,
 										page_size);
Signature · 1 line
2.35.1