archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <>
To: Oded Gabbay <>
Cc: Arnd Bergmann <>,
	Greg Kroah-Hartman <>,, Guenter Roeck <>,
	Ohad Sharabi <>
Subject: [PATCH (RESEND)] habanalabs: Fix test build failures
Date: Fri,  1 Apr 2022 08:14:50 -0700	[thread overview]
Message-ID: <> (raw)

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 <>
Signed-off-by: Guenter Roeck <>
Resend: Sorry, forgot to copy mailing list

 drivers/misc/habanalabs/common/memory.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c
index e008d82e4ba3..f0d373171d2a 100644
--- a/drivers/misc/habanalabs/common/memory.c
+++ b/drivers/misc/habanalabs/common/memory.c
@@ -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);
 				phys_pg_pack->pages[i] = (u64) gen_pool_alloc(vm->dram_pg_pool,

                 reply	other threads:[~2022-04-01 15:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).