Hi Mauro,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.17-rc7 next-20180529]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/media-dvb-get-rid-of-VIDEO_SET_SPU_PALETTE/20180530-033705
config: x86_64-randconfig-g0-05291849 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   fs/compat_ioctl.c: In function 'do_video_set_spu_palette':
   fs/compat_ioctl.c:220:45: error: invalid application of 'sizeof' to 
incomplete type 'struct video_spu_palette'
     up_native = compat_alloc_user_space(sizeof(struct video_spu_palette));
                                                ^
   In file included from include/linux/uaccess.h:14:0,
                    from include/linux/compat.h:20,
                    from fs/compat_ioctl.c:17:
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:257:15: note: in definition of macro 
'put_user'
     __typeof__(*(ptr)) __pu_val;    \
                  ^
   arch/x86/include/asm/uaccess.h:260:11: warning: assignment makes integer 
from pointer without a cast
     __pu_val = x;      \
              ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:261:19: note: in definition of macro 
'put_user'
     switch (sizeof(*(ptr))) {    \
                      ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
>> arch/x86/include/asm/uaccess.h:272:3: note: in expansion of macro 
>> '__put_user_x8'
      __put_user_x8(__pu_val, ptr, __ret_pu);  \
      ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
>> arch/x86/include/asm/uaccess.h:272:3: note: in expansion of macro 
>> '__put_user_x8'
      __put_user_x8(__pu_val, ptr, __ret_pu);  \
      ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
>> fs/compat_ioctl.c:221:46: error: dereferencing pointer to incomplete type
     err  = put_user(compat_ptr(palp), &up_native->palette);
                                                 ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
   fs/compat_ioctl.c:221:9: note: in expansion of macro 'put_user'
     err  = put_user(compat_ptr(palp), &up_native->palette);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:257:15: note: in definition of macro 
'put_user'
     __typeof__(*(ptr)) __pu_val;    \
                  ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:261:19: note: in definition of macro 
'put_user'
     switch (sizeof(*(ptr))) {    \
                      ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
>> arch/x86/include/asm/uaccess.h:272:3: note: in expansion of macro 
>> '__put_user_x8'
      __put_user_x8(__pu_val, ptr, __ret_pu);  \
      ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
>> arch/x86/include/asm/uaccess.h:272:3: note: in expansion of macro 
>> '__put_user_x8'
      __put_user_x8(__pu_val, ptr, __ret_pu);  \
      ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:25: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                            ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c:222:36: error: dereferencing pointer to incomplete type
     err |= put_user(length, &up_native->length);
                                       ^
   arch/x86/include/asm/uaccess.h:187:42: note: in definition of macro 
'__put_user_x'
           : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
                                             ^
   fs/compat_ioctl.c:222:9: note: in expansion of macro 'put_user'
     err |= put_user(length, &up_native->length);
            ^
   fs/compat_ioctl.c: At top level:
   fs/compat_ioctl.c:208:12: warning: 'do_video_set_spu_palette' defined but 
not used [-Wunused-function]
    static int do_video_set_spu_palette(struct file *file,
               ^

vim +221 fs/compat_ioctl.c

6e87abd0 David S. Miller 2005-11-16  207  
66cf191f Al Viro         2016-01-07  208  static int 
do_video_set_spu_palette(struct file *file,
b4341721 Jann Horn       2016-01-05  209                unsigned int cmd, 
struct compat_video_spu_palette __user *up)
6e87abd0 David S. Miller 2005-11-16  210  {
6e87abd0 David S. Miller 2005-11-16  211        struct video_spu_palette __user 
*up_native;
6e87abd0 David S. Miller 2005-11-16  212        compat_uptr_t palp;
6e87abd0 David S. Miller 2005-11-16  213        int length, err;
6e87abd0 David S. Miller 2005-11-16  214  
6e87abd0 David S. Miller 2005-11-16  215        err  = get_user(palp, 
&up->palette);
6e87abd0 David S. Miller 2005-11-16  216        err |= get_user(length, 
&up->length);
12176503 Kees Cook       2012-10-25  217        if (err)
12176503 Kees Cook       2012-10-25  218                return -EFAULT;
6e87abd0 David S. Miller 2005-11-16  219  
6e87abd0 David S. Miller 2005-11-16 @220        up_native = 
compat_alloc_user_space(sizeof(struct video_spu_palette));
7116e994 Heiko Carstens  2006-12-06 @221        err  = 
put_user(compat_ptr(palp), &up_native->palette);
7116e994 Heiko Carstens  2006-12-06  222        err |= put_user(length, 
&up_native->length);
7116e994 Heiko Carstens  2006-12-06  223        if (err)
7116e994 Heiko Carstens  2006-12-06  224                return -EFAULT;
6e87abd0 David S. Miller 2005-11-16  225  
66cf191f Al Viro         2016-01-07  226        err = do_ioctl(file, cmd, 
(unsigned long) up_native);
6e87abd0 David S. Miller 2005-11-16  227  
6e87abd0 David S. Miller 2005-11-16  228        return err;
6e87abd0 David S. Miller 2005-11-16  229  }
6e87abd0 David S. Miller 2005-11-16  230  

:::::: The code at line 221 was first introduced by commit
:::::: 7116e994b47f3988389be4ceee67dac64b56e0d0 [PATCH] compat: fix uaccess 
handling

:::::: TO: Heiko Carstens <heiko.carst...@de.ibm.com>
:::::: CC: Linus Torvalds <torva...@woody.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to