Hi Shunsuke, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on rdma/for-next] [also build test WARNING on v5.15-rc7 next-20211029] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Shunsuke-Mie/RDMA-rxe-Add-dma-buf-support/20211029-150351 base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next config: riscv-randconfig-r042-20211029 (attached as .config) compiler: riscv32-linux-gcc (GCC) 11.2.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/132b40bb2550f801c5e94fcde19f28b29b0852e2 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Shunsuke-Mie/RDMA-rxe-Add-dma-buf-support/20211029-150351 git checkout 132b40bb2550f801c5e94fcde19f28b29b0852e2 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=riscv If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/infiniband/sw/rxe/rxe_mr.c: In function 'rxe_map_dmabuf_mr': >> drivers/infiniband/sw/rxe/rxe_mr.c:256:23: warning: variable 'vaddr_end' set but not used [-Wunused-but-set-variable] 256 | void *vaddr, *vaddr_end; | ^~~~~~~~~ In file included from include/linux/dma-buf.h:16, from drivers/infiniband/sw/rxe/rxe_mr.c:7: drivers/infiniband/sw/rxe/rxe_mr.c: In function 'rxe_unmap_dmabuf_mr': >> drivers/infiniband/sw/rxe/rxe_mr.c:305:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 305 | (void *)mr->cur_map_set->map[0]->buf->addr); | ^ include/linux/dma-buf-map.h:129:27: note: in definition of macro 'DMA_BUF_MAP_INIT_VADDR' 129 | .vaddr = (vaddr_), \ | ^~~~~~ vim +/vaddr_end +256 drivers/infiniband/sw/rxe/rxe_mr.c 249 250 static int rxe_map_dmabuf_mr(struct rxe_mr *mr, 251 struct ib_umem_dmabuf *umem_dmabuf) 252 { 253 struct rxe_map_set *set; 254 struct rxe_phys_buf *buf = NULL; 255 struct rxe_map **map; > 256 void *vaddr, *vaddr_end; 257 int num_buf = 0; 258 int err; 259 size_t remain; 260 struct dma_buf_map dmabuf_map; 261 262 err = dma_buf_vmap(umem_dmabuf->dmabuf, &dmabuf_map); 263 if (err || dmabuf_map.is_iomem) 264 goto err_out; 265 266 set = mr->cur_map_set; 267 set->page_shift = PAGE_SHIFT; 268 set->page_mask = PAGE_SIZE - 1; 269 270 map = set->map; 271 buf = map[0]->buf; 272 273 vaddr = dmabuf_map.vaddr; 274 vaddr_end = vaddr + umem_dmabuf->dmabuf->size; 275 remain = umem_dmabuf->dmabuf->size; 276 277 for (; remain; vaddr += PAGE_SIZE) { 278 if (num_buf >= RXE_BUF_PER_MAP) { 279 map++; 280 buf = map[0]->buf; 281 num_buf = 0; 282 } 283 284 buf->addr = (uintptr_t)vaddr; 285 if (remain >= PAGE_SIZE) 286 buf->size = PAGE_SIZE; 287 else 288 buf->size = remain; 289 remain -= buf->size; 290 291 num_buf++; 292 buf++; 293 } 294 295 return 0; 296 297 err_out: 298 return err; 299 } 300 301 static void rxe_unmap_dmabuf_mr(struct rxe_mr *mr) 302 { 303 struct ib_umem_dmabuf *umem_dmabuf = to_ib_umem_dmabuf(mr->umem); 304 struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR( > 305 (void *)mr->cur_map_set->map[0]->buf->addr); 306 307 dma_buf_vunmap(umem_dmabuf->dmabuf, &map); 308 } 309 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org