[jsarha:topic/cros-sof-v4.19 1155/6555] drivers/gpu/drm/drm_atomic_uapi.c:366:13: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Sun Apr 24 2022 - 03:45:41 EST


tree: https://github.com/jsarha/linux topic/cros-sof-v4.19
head: d7a3e91d8d16d1ef8653deec5a1fffc4de034a0c
commit: dfdec43d0411076dc70591a0496a0824a8620695 [1155/6555] UPSTREAM: drm: extract drm_atomic_uapi.c
config: xtensa-randconfig-s032-20220419 (https://download.01.org/0day-ci/archive/20220424/202204241549.5cRUbpNf-lkp@xxxxxxxxx/config)
compiler: xtensa-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/jsarha/linux/commit/dfdec43d0411076dc70591a0496a0824a8620695
git remote add jsarha https://github.com/jsarha/linux
git fetch --no-tags jsarha topic/cros-sof-v4.19
git checkout dfdec43d0411076dc70591a0496a0824a8620695
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=xtensa SHELL=/bin/bash drivers/gpu/drm/ fs/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
drivers/gpu/drm/drm_atomic_uapi.c:366:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected signed int *__pu_addr @@ got signed int [noderef] [usertype] <asn:1> *fence_ptr @@
drivers/gpu/drm/drm_atomic_uapi.c:366:13: sparse: expected signed int *__pu_addr
drivers/gpu/drm/drm_atomic_uapi.c:366:13: sparse: got signed int [noderef] [usertype] <asn:1> *fence_ptr
>> drivers/gpu/drm/drm_atomic_uapi.c:366:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *to @@ got signed int *__pu_addr @@
drivers/gpu/drm/drm_atomic_uapi.c:366:13: sparse: expected void [noderef] <asn:1> *to
drivers/gpu/drm/drm_atomic_uapi.c:366:13: sparse: got signed int *__pu_addr
drivers/gpu/drm/drm_atomic_uapi.c:466:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected signed int *__pu_addr @@ got signed int [noderef] [usertype] <asn:1> *fence_ptr @@
drivers/gpu/drm/drm_atomic_uapi.c:466:21: sparse: expected signed int *__pu_addr
drivers/gpu/drm/drm_atomic_uapi.c:466:21: sparse: got signed int [noderef] [usertype] <asn:1> *fence_ptr
drivers/gpu/drm/drm_atomic_uapi.c:466:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *to @@ got signed int *__pu_addr @@
drivers/gpu/drm/drm_atomic_uapi.c:466:21: sparse: expected void [noderef] <asn:1> *to
drivers/gpu/drm/drm_atomic_uapi.c:466:21: sparse: got signed int *__pu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1052:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected signed int *__pu_addr @@ got signed int [noderef] [usertype] <asn:1> *out_fence_ptr @@
drivers/gpu/drm/drm_atomic_uapi.c:1052:13: sparse: expected signed int *__pu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1052:13: sparse: got signed int [noderef] [usertype] <asn:1> *out_fence_ptr
drivers/gpu/drm/drm_atomic_uapi.c:1052:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *to @@ got signed int *__pu_addr @@
drivers/gpu/drm/drm_atomic_uapi.c:1052:13: sparse: expected void [noderef] <asn:1> *to
drivers/gpu/drm/drm_atomic_uapi.c:1052:13: sparse: got signed int *__pu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1230:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected signed int *__pu_addr @@ got signed int [noderef] [usertype] <asn:1> *out_fence_ptr @@
drivers/gpu/drm/drm_atomic_uapi.c:1230:21: sparse: expected signed int *__pu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1230:21: sparse: got signed int [noderef] [usertype] <asn:1> *out_fence_ptr
drivers/gpu/drm/drm_atomic_uapi.c:1230:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *to @@ got signed int *__pu_addr @@
drivers/gpu/drm/drm_atomic_uapi.c:1230:21: sparse: expected void [noderef] <asn:1> *to
drivers/gpu/drm/drm_atomic_uapi.c:1230:21: sparse: got signed int *__pu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1297:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] [usertype] <asn:1> * @@
drivers/gpu/drm/drm_atomic_uapi.c:1297:21: sparse: expected unsigned int const *__gu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1297:21: sparse: got unsigned int [noderef] [usertype] <asn:1> *
>> drivers/gpu/drm/drm_atomic_uapi.c:1297:21: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got unsigned int const *__gu_addr @@
drivers/gpu/drm/drm_atomic_uapi.c:1297:21: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/drm/drm_atomic_uapi.c:1297:21: sparse: got unsigned int const *__gu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1314:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] [usertype] <asn:1> * @@
drivers/gpu/drm/drm_atomic_uapi.c:1314:21: sparse: expected unsigned int const *__gu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1314:21: sparse: got unsigned int [noderef] [usertype] <asn:1> *
drivers/gpu/drm/drm_atomic_uapi.c:1314:21: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got unsigned int const *__gu_addr @@
drivers/gpu/drm/drm_atomic_uapi.c:1314:21: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/drm/drm_atomic_uapi.c:1314:21: sparse: got unsigned int const *__gu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1327:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] [usertype] <asn:1> * @@
drivers/gpu/drm/drm_atomic_uapi.c:1327:29: sparse: expected unsigned int const *__gu_addr
drivers/gpu/drm/drm_atomic_uapi.c:1327:29: sparse: got unsigned int [noderef] [usertype] <asn:1> *
drivers/gpu/drm/drm_atomic_uapi.c:1327:29: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got unsigned int const *__gu_addr @@
drivers/gpu/drm/drm_atomic_uapi.c:1327:29: sparse: expected void const [noderef] <asn:1> *from
drivers/gpu/drm/drm_atomic_uapi.c:1327:29: sparse: got unsigned int const *__gu_addr
drivers/gpu/drm/drm_atomic_uapi.c: In function 'complete_signaling':
drivers/gpu/drm/drm_atomic_uapi.c:1193:26: warning: variable 'crtc' set but not used [-Wunused-but-set-variable]
1193 | struct drm_crtc *crtc;
| ^~~~

vim +366 drivers/gpu/drm/drm_atomic_uapi.c

356
357 static int set_out_fence_for_connector(struct drm_atomic_state *state,
358 struct drm_connector *connector,
359 s32 __user *fence_ptr)
360 {
361 unsigned int index = drm_connector_index(connector);
362
363 if (!fence_ptr)
364 return 0;
365
> 366 if (put_user(-1, fence_ptr))
367 return -EFAULT;
368
369 state->connectors[index].out_fence_ptr = fence_ptr;
370
371 return 0;
372 }
373

--
0-DAY CI Kernel Test Service
https://01.org/lkp