[PATCH] gpu/drm: Use u64_to_user_pointer

kbuild test robot lkp at intel.com
Fri Mar 18 17:46:34 UTC 2016


Hi Joe,

[auto build test WARNING on drm/drm-next]
[also build test WARNING on next-20160318]
[cannot apply to v4.5]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Joe-Perches/gpu-drm-Use-u64_to_user_pointer/20160319-012749
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: mips-allmodconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All warnings (new ones prefixed by >>):

   In file included from include/linux/uaccess.h:5:0,
                    from include/linux/highmem.h:8,
                    from include/drm/drmP.h:40,
                    from drivers/gpu/drm/vc4/vc4_drv.h:9,
                    from drivers/gpu/drm/vc4/vc4_bo.c:21:
   drivers/gpu/drm/vc4/vc4_bo.c: In function 'vc4_create_shader_bo_ioctl':
   drivers/gpu/drm/vc4/vc4_bo.c:503:7: error: implicit declaration of function 'u64_to_user_ptr' [-Werror=implicit-function-declaration]
          u64_to_user_ptr(args->data),
          ^
   arch/mips/include/asm/uaccess.h:1161:15: note: in definition of macro 'copy_from_user'
     __cu_from = (from);      \
                  ^
>> arch/mips/include/asm/uaccess.h:1161:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     __cu_from = (from);      \
               ^
   drivers/gpu/drm/vc4/vc4_bo.c:502:6: note: in expansion of macro 'copy_from_user'
     if (copy_from_user(bo->base.vaddr,
         ^
   cc1: some warnings being treated as errors
--
   In file included from arch/mips/include/asm/module.h:6:0,
                    from include/linux/module.h:24,
                    from drivers/gpu/drm/vc4/vc4_gem.c:24:
   drivers/gpu/drm/vc4/vc4_gem.c: In function 'vc4_get_hang_state_ioctl':
   drivers/gpu/drm/vc4/vc4_gem.c:123:19: error: implicit declaration of function 'u64_to_user_ptr' [-Werror=implicit-function-declaration]
     if (copy_to_user(u64_to_user_ptr(get_state->bo),
                      ^
   arch/mips/include/asm/uaccess.h:930:13: note: in definition of macro 'copy_to_user'
     __cu_to = (to);       \
                ^
   arch/mips/include/asm/uaccess.h:930:10: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     __cu_to = (to);       \
             ^
   drivers/gpu/drm/vc4/vc4_gem.c:123:6: note: in expansion of macro 'copy_to_user'
     if (copy_to_user(u64_to_user_ptr(get_state->bo),
         ^
   drivers/gpu/drm/vc4/vc4_gem.c: In function 'vc4_cl_lookup_bos':
>> arch/mips/include/asm/uaccess.h:1161:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     __cu_from = (from);      \
               ^
   drivers/gpu/drm/vc4/vc4_gem.c:552:8: note: in expansion of macro 'copy_from_user'
     ret = copy_from_user(handles,
           ^
   drivers/gpu/drm/vc4/vc4_gem.c: In function 'vc4_get_bcl':
>> arch/mips/include/asm/uaccess.h:1161:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     __cu_from = (from);      \
               ^
   drivers/gpu/drm/vc4/vc4_gem.c:626:6: note: in expansion of macro 'copy_from_user'
     if (copy_from_user(bin,
         ^
>> arch/mips/include/asm/uaccess.h:1161:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     __cu_from = (from);      \
               ^
   drivers/gpu/drm/vc4/vc4_gem.c:633:6: note: in expansion of macro 'copy_from_user'
     if (copy_from_user(exec->shader_rec_u,
         ^
>> arch/mips/include/asm/uaccess.h:1161:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     __cu_from = (from);      \
               ^
   drivers/gpu/drm/vc4/vc4_gem.c:640:6: note: in expansion of macro 'copy_from_user'
     if (copy_from_user(exec->uniforms_u,
         ^
   cc1: some warnings being treated as errors

vim +1161 arch/mips/include/asm/uaccess.h

^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1145   *
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1146   * Copy data from user space to kernel space.
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1147   *
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1148   * Returns number of bytes that could not be copied.
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1149   * On success, this will be zero.
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1150   *
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1151   * If some data could not be copied, this function will pad the copied
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1152   * data to the requested size using zero bytes.
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1153   */
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1154  #define copy_from_user(to, from, n)					\
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1155  ({									\
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1156  	void *__cu_to;							\
fe00f943 include/asm-mips/uaccess.h      Ralf Baechle    2005-03-01  1157  	const void __user *__cu_from;					\
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1158  	long __cu_len;							\
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1159  									\
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1160  	__cu_to = (to);							\
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16 @1161  	__cu_from = (from);						\
^1da177e include/asm-mips/uaccess.h      Linus Torvalds  2005-04-16  1162  	__cu_len = (n);							\
12060666 arch/mips/include/asm/uaccess.h Paul Burton     2015-05-24  1163  	if (eva_kernel_access()) {					\
05c65160 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-11  1164  		__cu_len = __invoke_copy_from_kernel(__cu_to,		\
05c65160 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-11  1165  						     __cu_from,		\
05c65160 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-11  1166  						     __cu_len);		\
05c65160 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-11  1167  	} else {							\
ef41f460 arch/mips/include/asm/uaccess.h Ralf Baechle    2009-04-28  1168  		if (access_ok(VERIFY_READ, __cu_from, __cu_len)) {	\
ef41f460 arch/mips/include/asm/uaccess.h Ralf Baechle    2009-04-28  1169  			might_fault();                                  \

:::::: The code at line 1161 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds at ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds at ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 40472 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160319/887417de/attachment-0001.obj>


More information about the dri-devel mailing list