Search Linux Wireless

Re: [PATCH] drivers: staging: wilc1000/host_interface.c Fix sparse warning: right shift by bigger than source value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Guillermo,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on next-20170626]
[cannot apply to v4.12-rc7]
[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/Guillermo-O-Freschi/drivers-staging-wilc1000-host_interface-c-Fix-sparse-warning-right-shift-by-bigger-than-source-value/20170626-173132
config: x86_64-randconfig-x007-201726 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/staging/wilc1000/host_interface.c: In function 'Handle_SetMulticastFilter':
>> drivers/staging/wilc1000/host_interface.c:2420:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     u32 enabled = strHostIfSetMulti->enabled;
     ^~~

vim +2420 drivers/staging/wilc1000/host_interface.c

  2404	static void Handle_SetMulticastFilter(struct wilc_vif *vif,
  2405					      struct set_multicast *strHostIfSetMulti)
  2406	{
  2407		s32 result = 0;
  2408		struct wid wid;
  2409		u8 *pu8CurrByte;
  2410	
  2411		wid.id = (u16)WID_SETUP_MULTICAST_FILTER;
  2412		wid.type = WID_BIN;
  2413		wid.size = sizeof(struct set_multicast) + ((strHostIfSetMulti->cnt) * ETH_ALEN);
  2414		wid.val = kmalloc(wid.size, GFP_KERNEL);
  2415		if (!wid.val)
  2416			goto ERRORHANDLER;
  2417	
  2418		pu8CurrByte = wid.val;
  2419	
> 2420		u32 enabled = strHostIfSetMulti->enabled;
  2421		*pu8CurrByte++ = (enabled & 0xFF);
  2422		*pu8CurrByte++ = ((enabled >> 8) & 0xFF);
  2423		*pu8CurrByte++ = ((enabled >> 16) & 0xFF);
  2424		*pu8CurrByte++ = ((enabled >> 24) & 0xFF);
  2425	
  2426		*pu8CurrByte++ = (strHostIfSetMulti->cnt & 0xFF);
  2427		*pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF);
  2428		*pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 16) & 0xFF);

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux