Hi Wu,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.11-rc4 next-20170331]
[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/Wu-Hao/Intel-FPGA-Device-Drivers/20170401-052017
config: frv-allmodconfig (attached as .config)
compiler: frv-linux-gcc (GCC) 6.2.0
reproduce:
        wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=frv 

All warnings (new ones prefixed by >>):

   In file included from include/linux/uaccess.h:5:0,
                    from drivers/fpga/intel/afu-dma-region.c:17:
   drivers/fpga/intel/afu-dma-region.c: In function 'afu_dma_map_region':
   arch/frv/include/asm/uaccess.h:63:47: warning: cast to pointer from integer 
of different size [-Wint-to-pointer-cast]
    #define access_ok(type,addr,size) (__range_ok((void __user *)(addr), 
(size)) == 0)
                                                  ^
   arch/frv/include/asm/uaccess.h:61:60: note: in definition of macro 
'__range_ok'
    #define __range_ok(addr,size) ___range_ok((unsigned long) (addr), (unsigned 
long) (size))
                                                               ^~~~
>> drivers/fpga/intel/afu-dma-region.c:291:7: note: in expansion of macro 
>> 'access_ok'
     if (!access_ok(VERIFY_WRITE, user_addr, length))
          ^~~~~~~~~

vim +/access_ok +291 drivers/fpga/intel/afu-dma-region.c

   275                         u64 user_addr, u64 length, u64 *iova)
   276  {
   277          struct fpga_afu_dma_region *region;
   278          int ret;
   279  
   280          /*
   281           * Check Inputs, only accept page-aligned user memory region 
with
   282           * valid length.
   283           */
   284          if (!PAGE_ALIGNED(user_addr) || !PAGE_ALIGNED(length) || 
!length)
   285                  return -EINVAL;
   286  
   287          /* Check overflow */
   288          if (user_addr + length < user_addr)
   289                  return -EINVAL;
   290  
 > 291          if (!access_ok(VERIFY_WRITE, user_addr, length))
   292                  return -EINVAL;
   293  
   294          region = kzalloc(sizeof(*region), GFP_KERNEL);
   295          if (!region)
   296                  return -ENOMEM;
   297  
   298          region->user_addr = user_addr;
   299          region->length = length;

---
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