staging: r8188eu: Fix compiler warnings in os_dep/ioctl_linux.c
authorLarry Finger <Larry.Finger@lwfinger.net>
Thu, 29 Aug 2013 02:12:25 +0000 (21:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Aug 2013 18:46:46 +0000 (11:46 -0700)
commit40fac5a1322719074312e58273392e9b652c64a1
tree674ee1eddf7659e2dbf0b68685f18fd7a285aa29
parent351699d7ebb1e489d2ee5b51d1b4dd4cc2a822ac
staging: r8188eu: Fix compiler warnings in os_dep/ioctl_linux.c

The 0-DAY kernel build testing backend reports the following compiler
warnings not shown on my compiler version/options:

   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_mp_efuse_get':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:5836:65: warning: iteration 16u invokes undefined behavior [-Waggressive-loop-optimizations]
        sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseInitMap[i+j]);
                                                                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:5830:3: note: containing loop
      for (i = 0; i < EFUSE_MAP_SIZE; i += 16) {
      ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:6042:69: warning: iteration 16u invokes undefined behavior [-Waggressive-loop-optimizations]
        sprintf(extra, "%s %02X", extra, pEfuseHal->fakeEfuseModifiedMap[i+j]);
                                                                        ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:6036:3: note: containing loop
      for (i = 0; i < EFUSE_MAP_SIZE; i += 16) {
      ^

The problem is due to improper settings for some of the EFUSE_XXX defines such that
EFUSE_MAP_SIZE was larger than the sizes of the marked arrays. Thanks to
Fengguang Wu for helping me understand the root cause.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/include/rtl8188e_hal.h
drivers/staging/rtl8188eu/include/rtw_efuse.h