Hi Hans,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[cannot apply to v5.3-rc4 next-20190814]
[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/Hans-Verkuil/gspca-zero-usb_buf-on-error/20190816-123155
base:   git://linuxtv.org/media_tree.git master
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <l...@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/string.h:20:0,
                    from include/linux/bitmap.h:9,
                    from include/linux/nodemask.h:95,
                    from include/linux/mmzone.h:17,
                    from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:13,
                    from drivers/media/usb/gspca/gspca.h:5,
                    from drivers/media/usb/gspca/nw80x.c:14:
   drivers/media/usb/gspca/nw80x.c: In function 'reg_r':
>> drivers/media/usb/gspca/nw80x.c:1579:39: warning: argument to 'sizeof' in 
>> '__builtin_memset' call is the same expression as the destination; did you 
>> mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
      memset(gspca_dev->usb_buf, 0, sizeof(gspca_dev->usb_buf));
                                          ^
   arch/sparc/include/asm/string.h:18:52: note: in definition of macro 'memset'
    #define memset(s, c, count) __builtin_memset(s, c, count)
                                                       ^~~~~
--
   In file included from include/linux/string.h:20:0,
                    from include/linux/bitmap.h:9,
                    from include/linux/cpumask.h:12,
                    from include/linux/rcupdate.h:31,
                    from include/linux/radix-tree.h:15,
                    from include/linux/idr.h:15,
                    from include/linux/kernfs.h:13,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:16,
                    from include/linux/input.h:19,
                    from drivers/media/usb/gspca/sn9c20x.c:12:
   drivers/media/usb/gspca/sn9c20x.c: In function 'reg_r':
>> drivers/media/usb/gspca/sn9c20x.c:916:39: warning: argument to 'sizeof' in 
>> '__builtin_memset' call is the same expression as the destination; did you 
>> mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
      memset(gspca_dev->usb_buf, 0, sizeof(gspca_dev->usb_buf));
                                          ^
   arch/sparc/include/asm/string.h:18:52: note: in definition of macro 'memset'
    #define memset(s, c, count) __builtin_memset(s, c, count)
                                                       ^~~~~
--
   In file included from include/linux/string.h:20:0,
                    from include/linux/bitmap.h:9,
                    from include/linux/cpumask.h:12,
                    from include/linux/rcupdate.h:31,
                    from include/linux/radix-tree.h:15,
                    from include/linux/idr.h:15,
                    from include/linux/kernfs.h:13,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:16,
                    from include/linux/input.h:19,
                    from drivers/media/usb/gspca/sonixj.c:13:
   drivers/media/usb/gspca/sonixj.c: In function 'reg_r':
>> drivers/media/usb/gspca/sonixj.c:1169:39: warning: argument to 'sizeof' in 
>> '__builtin_memset' call is the same expression as the destination; did you 
>> mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
      memset(gspca_dev->usb_buf, 0, sizeof(gspca_dev->usb_buf));
                                          ^
   arch/sparc/include/asm/string.h:18:52: note: in definition of macro 'memset'
    #define memset(s, c, count) __builtin_memset(s, c, count)
                                                       ^~~~~
--
   In file included from include/linux/string.h:20:0,
                    from include/linux/bitmap.h:9,
                    from include/linux/nodemask.h:95,
                    from include/linux/mmzone.h:17,
                    from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:13,
                    from drivers/media/usb/gspca/gspca.h:5,
                    from drivers/media/usb/gspca/spca1528.c:12:
   drivers/media/usb/gspca/spca1528.c: In function 'reg_r':
>> drivers/media/usb/gspca/spca1528.c:78:39: warning: argument to 'sizeof' in 
>> '__builtin_memset' call is the same expression as the destination; did you 
>> mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
      memset(gspca_dev->usb_buf, 0, sizeof(gspca_dev->usb_buf));
                                          ^
   arch/sparc/include/asm/string.h:18:52: note: in definition of macro 'memset'
    #define memset(s, c, count) __builtin_memset(s, c, count)
                                                       ^~~~~
--
   In file included from include/linux/string.h:20:0,
                    from include/linux/bitmap.h:9,
                    from include/linux/nodemask.h:95,
                    from include/linux/mmzone.h:17,
                    from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:13,
                    from drivers/media/usb/gspca/gspca.h:5,
                    from drivers/media/usb/gspca/sq930x.c:14:
   drivers/media/usb/gspca/sq930x.c: In function 'reg_r':
>> drivers/media/usb/gspca/sq930x.c:432:39: warning: argument to 'sizeof' in 
>> '__builtin_memset' call is the same expression as the destination; did you 
>> mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
      memset(gspca_dev->usb_buf, 0, sizeof(gspca_dev->usb_buf));
                                          ^
   arch/sparc/include/asm/string.h:18:52: note: in definition of macro 'memset'
    #define memset(s, c, count) __builtin_memset(s, c, count)
                                                       ^~~~~
--
   In file included from include/linux/string.h:20:0,
                    from include/linux/bitmap.h:9,
                    from include/linux/nodemask.h:95,
                    from include/linux/mmzone.h:17,
                    from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:13,
                    from drivers/media/usb/gspca/gspca.h:5,
                    from drivers/media/usb/gspca/sunplus.c:13:
   drivers/media/usb/gspca/sunplus.c: In function 'reg_r':
>> drivers/media/usb/gspca/sunplus.c:262:39: warning: argument to 'sizeof' in 
>> '__builtin_memset' call is the same expression as the destination; did you 
>> mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
      memset(gspca_dev->usb_buf, 0, sizeof(gspca_dev->usb_buf));
                                          ^
   arch/sparc/include/asm/string.h:18:52: note: in definition of macro 'memset'
    #define memset(s, c, count) __builtin_memset(s, c, count)
                                                       ^~~~~
--
   In file included from include/linux/string.h:20:0,
                    from include/linux/bitmap.h:9,
                    from include/linux/nodemask.h:95,
                    from include/linux/mmzone.h:17,
                    from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:13,
                    from drivers/media/usb/gspca/gspca.h:5,
                    from drivers/media/usb/gspca/vc032x.c:14:
   drivers/media/usb/gspca/vc032x.c: In function 'reg_r_i':
>> drivers/media/usb/gspca/vc032x.c:2913:39: warning: argument to 'sizeof' in 
>> '__builtin_memset' call is the same expression as the destination; did you 
>> mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
      memset(gspca_dev->usb_buf, 0, sizeof(gspca_dev->usb_buf));
                                          ^
   arch/sparc/include/asm/string.h:18:52: note: in definition of macro 'memset'
    #define memset(s, c, count) __builtin_memset(s, c, count)
                                                       ^~~~~

vim +1579 drivers/media/usb/gspca/nw80x.c

  1556  
  1557  /* -- read registers in usb_buf -- */
  1558  static void reg_r(struct gspca_dev *gspca_dev,
  1559                          u16 index,
  1560                          int len)
  1561  {
  1562          struct usb_device *dev = gspca_dev->dev;
  1563          int ret;
  1564  
  1565          if (gspca_dev->usb_err < 0)
  1566                  return;
  1567          ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
  1568                          0x00,
  1569                          USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
  1570                          0x00, index,
  1571                          gspca_dev->usb_buf, len, 500);
  1572          if (ret < 0) {
  1573                  pr_err("reg_r err %d\n", ret);
  1574                  gspca_dev->usb_err = ret;
  1575                  /*
  1576                   * Make sure the buffer is zeroed to avoid uninitialized
  1577                   * values.
  1578                   */
> 1579                  memset(gspca_dev->usb_buf, 0, 
> sizeof(gspca_dev->usb_buf));
  1580                  return;
  1581          }
  1582          if (len == 1)
  1583                  gspca_dbg(gspca_dev, D_USBI, "GET 00 0000 %04x %02x\n",
  1584                            index, gspca_dev->usb_buf[0]);
  1585          else
  1586                  gspca_dbg(gspca_dev, D_USBI, "GET 00 0000 %04x %02x 
%02x ..\n",
  1587                            index, gspca_dev->usb_buf[0],
  1588                            gspca_dev->usb_buf[1]);
  1589  }
  1590  

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