Skip to content

Commit f58d341

Browse files
committed
Merge tag 'char-misc-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fix from Greg KH: "A single driver fix. It resolves the build warning issue on 32bit systems in the habannalabs driver that came in during the 5.18-rc1 merge cycle. It has been in linux-next for all this week with no reported problems" * tag 'char-misc-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: habanalabs: Fix test build failures
2 parents 4ea3c64 + 94865e2 commit f58d341

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/misc/habanalabs/common/memory.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args,
111111

112112
if (contiguous) {
113113
if (is_power_of_2(page_size))
114-
paddr = (u64) (uintptr_t) gen_pool_dma_alloc_align(vm->dram_pg_pool,
115-
total_size, NULL, page_size);
114+
paddr = (uintptr_t) gen_pool_dma_alloc_align(vm->dram_pg_pool,
115+
total_size, NULL, page_size);
116116
else
117-
paddr = (u64) (uintptr_t) gen_pool_alloc(vm->dram_pg_pool, total_size);
117+
paddr = gen_pool_alloc(vm->dram_pg_pool, total_size);
118118
if (!paddr) {
119119
dev_err(hdev->dev,
120120
"failed to allocate %llu contiguous pages with total size of %llu\n",
@@ -150,12 +150,12 @@ static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args,
150150
for (i = 0 ; i < num_pgs ; i++) {
151151
if (is_power_of_2(page_size))
152152
phys_pg_pack->pages[i] =
153-
(u64) gen_pool_dma_alloc_align(vm->dram_pg_pool,
154-
page_size, NULL,
155-
page_size);
153+
(uintptr_t)gen_pool_dma_alloc_align(vm->dram_pg_pool,
154+
page_size, NULL,
155+
page_size);
156156
else
157-
phys_pg_pack->pages[i] = (u64) gen_pool_alloc(vm->dram_pg_pool,
158-
page_size);
157+
phys_pg_pack->pages[i] = gen_pool_alloc(vm->dram_pg_pool,
158+
page_size);
159159
if (!phys_pg_pack->pages[i]) {
160160
dev_err(hdev->dev,
161161
"Failed to allocate device memory (out of memory)\n");

0 commit comments

Comments
 (0)