lkml.org 
[lkml]   [2022]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [linux-stable-rc:linux-5.4.y 5364/5387] drivers/infiniband/sw/siw/siw_qp_tx.c:32:37: warning: cast to pointer from integer of different size
On Fri, Sep 16, 2022 at 8:19 PM kernel test robot <lkp@intel.com> wrote:

> commit: e7f78835d551bb2deb5aa3346d84c8f03ade313d [5364/5387] RDMA/siw: Pass a pointer to virt_to_page()
> config: riscv-randconfig-r013-20220916 (https://download.01.org/0day-ci/archive/20220917/202209170232.grVMomkJ-lkp@intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 12.1.0

So if RISCV32 ...

> 31 if (paddr)
> > 32 return virt_to_page((void *)paddr);

Think that passing a (void *) to virt_to_page() is a problem:

> warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> 32 | return virt_to_page((void *)paddr);

I would think this is a problem with RISCV32.

What has this arch done?

This is a few lines up:

> dma_addr_t paddr = siw_pbl_get_buffer(pbl, offset, NULL, idx);

dma_addr_t is a different size than (void *)?

Given that the patch raising this problem looked like this:

- return virt_to_page(paddr);
+ return virt_to_page((void *)paddr);

I doubt that it has created a bug that wasn't there before. Passing
a dma_addr_t to virt_to_page() might be wrong, but that is what the
driver has been doing all the time.

siw_pbl_get_buffer() claims to
"Gets physical address backed by PBL element."
Why is that even passed to virt_to_page() if it's no virtual address
but a dma_addr_t to begin with?

I certainly don't understand SIW, but this bug, if it is a bug (or a type and
documentation bug) is clearly not new.

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2022-09-18 16:34    [W:0.047 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site