[kbusch:io_uring/dma-register-v2 7/8] io_uring/io_uring.c:3791:45: error: passing argument 2 of 'file_dma_map' from incompatible pointer type
From: kernel test robot
Date: Fri Aug 12 2022 - 12:37:55 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kbusch/linux.git io_uring/dma-register-v2
head: c86a9580d33ff9bf90c685f452b66b929f1dc5fe
commit: ba3ab9f0c82ae764b7da4cb7e8df548439b2ec72 [7/8] io_uring: add support for dma pre-mapping
config: sh-randconfig-c043-20220811 (https://download.01.org/0day-ci/archive/20220813/202208130039.jwwRVomj-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 12.1.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://git.kernel.org/pub/scm/linux/kernel/git/kbusch/linux.git/commit/?id=ba3ab9f0c82ae764b7da4cb7e8df548439b2ec72
git remote add kbusch https://git.kernel.org/pub/scm/linux/kernel/git/kbusch/linux.git
git fetch --no-tags kbusch io_uring/dma-register-v2
git checkout ba3ab9f0c82ae764b7da4cb7e8df548439b2ec72
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All errors (new ones prefixed by >>):
In file included from include/uapi/linux/aio_abi.h:31,
from include/linux/syscalls.h:77,
from io_uring/io_uring.c:45:
include/linux/fs.h:3610:60: warning: 'struct bio_vec' declared inside parameter list will not be visible outside of this definition or declaration
3610 | static inline void *file_dma_map(struct file *file, struct bio_vec *bvec,
| ^~~~~~~
io_uring/io_uring.c: In function '__io_submit_flush_completions':
io_uring/io_uring.c:1183:40: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
1183 | struct io_wq_work_node *node, *prev;
| ^~~~
io_uring/io_uring.c: In function 'io_register_map_buffers':
>> io_uring/io_uring.c:3791:45: error: passing argument 2 of 'file_dma_map' from incompatible pointer type [-Werror=incompatible-pointer-types]
3791 | tag = file_dma_map(file, imu->bvec, imu->nr_bvecs);
| ~~~^~~~~~
| |
| struct bio_vec *
include/linux/fs.h:3610:69: note: expected 'struct bio_vec *' but argument is of type 'struct bio_vec *'
3610 | static inline void *file_dma_map(struct file *file, struct bio_vec *bvec,
| ~~~~~~~~~~~~~~~~^~~~
cc1: some warnings being treated as errors
vim +/file_dma_map +3791 io_uring/io_uring.c
3758
3759 static int io_register_map_buffers(struct io_ring_ctx *ctx, void __user *arg)
3760 {
3761 struct io_uring_map_buffers map;
3762 struct io_fixed_file *file_slot;
3763 struct file *file;
3764 int ret, i;
3765
3766 if (!capable(CAP_SYS_ADMIN))
3767 return -EPERM;
3768
3769 ret = get_map_range(ctx, &map, arg);
3770 if (ret < 0)
3771 return ret;
3772
3773 file_slot = io_fixed_file_slot(&ctx->file_table,
3774 array_index_nospec(map.fd, ctx->nr_user_files));
3775 if (!file_slot->file_ptr)
3776 return -EBADF;
3777
3778 file = io_file_from_fixed(file_slot);
3779 if (!(file->f_flags & O_DIRECT))
3780 return -EOPNOTSUPP;
3781
3782 for (i = map.buf_start; i < map.buf_end; i++) {
3783 struct io_mapped_ubuf *imu = ctx->user_bufs[i];
3784 void *tag;
3785
3786 if (imu->dma_tag) {
3787 ret = -EBUSY;
3788 goto err;
3789 }
3790
> 3791 tag = file_dma_map(file, imu->bvec, imu->nr_bvecs);
3792 if (IS_ERR(tag)) {
3793 ret = PTR_ERR(tag);
3794 goto err;
3795 }
3796
3797 imu->dma_tag = tag;
3798 imu->dma_file = file;
3799 }
3800
3801 return 0;
3802 err:
3803 while (--i >= map.buf_start) {
3804 struct io_mapped_ubuf *imu = ctx->user_bufs[i];
3805
3806 io_dma_unmap(imu);
3807 }
3808 return ret;
3809 }
3810
--
0-DAY CI Kernel Test Service
https://01.org/lkp