All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: Ohad Sharabi <osharabi@habana.ai>
Cc: Oded Gabbay <ogabbay@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Max Filippov <jcmvbkbc@gmail.com>
Subject: [PATCH] habanalabs: fix build warning
Date: Thu, 31 Mar 2022 21:16:15 -0700	[thread overview]
Message-ID: <20220401041615.3296387-1-jcmvbkbc@gmail.com> (raw)

allmodconfig build fails on ARCH=xtensa with the following message:

  drivers/misc/habanalabs/common/memory.c:153:49: error: cast from pointer
	to integer of different size [-Werror=pointer-to-int-cast]
	(u64) gen_pool_dma_alloc_align(vm->dram_pg_pool,

Fix it by adding intermediate conversion to uintptr_t as in other places
in that driver.

Fixes: e8458e20e0a3 ("habanalabs: make sure device mem alloc is page aligned")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 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);
 			else
 				phys_pg_pack->pages[i] = (u64) gen_pool_alloc(vm->dram_pg_pool,
 										page_size);
-- 
2.30.2


             reply	other threads:[~2022-04-01  4:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  4:16 Max Filippov [this message]
2022-04-01  6:40 ` [PATCH] habanalabs: fix build warning Arnd Bergmann
2022-04-01  6:55   ` Oded Gabbay
2022-04-01  7:53     ` Arnd Bergmann
2022-04-01 11:31       ` Oded Gabbay

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20220401041615.3296387-1-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ogabbay@kernel.org \
    --cc=osharabi@habana.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.