Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.16] Fix outstanding GCC 6.4.0 and GCC 7.3.0 warnings #2418

Merged
merged 4 commits into from
Mar 13, 2018

Conversation

nathanchance
Copy link
Contributor

Same ones as #2413, with a couple of extra commits ported forward from older branches since it appears d3b1ce0 overrode the fixes from 9db27f3 and 6529008 in 2d806f1. I will look into submitting these upstream so you don't have to worry about constantly carrying them forward.

marckleinebudde and others added 4 commits March 5, 2018 09:07
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c: In function ‘PHY_RFShadowRefresh’:
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c:1020:37: warning: iteration 63 invokes undefined behavior [-Waggressive-loop-optimizations]
    RF_Shadow[eRFPath][Offset].Value = 0;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c:1018:3: note: within this loop
   for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
   ^~~

Signed-off-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
These warnings appear with GCC 6.4.0 from toolchains.bootlin.com:

../drivers/net/wireless/realtek/rtl8192cu/core/rtw_security.c: In function ‘aes_cipher’:
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_security.c:1504:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
     for (j = 0; j < 8; j++)
     ^~~
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_security.c:1507:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
  payload_index = hdrlen + 8;
  ^~~~~~~~~~~~~
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_security.c: In function ‘aes_decipher’:
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_security.c:1878:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
     for (j = 0; j < 8; j++)
     ^~~
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_security.c:1881:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
  payload_index = hdrlen + 8;
  ^~~~~~~~~~~~~

../drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c:5666:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if( _rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN) );
     ^~
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c:5667:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
      _rtw_memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN);
      ^~~~~~~~~~~

It appears to be due to tabs versus spaces.

Signed-off-by: Nathan Chancellor <[email protected]>
Compiler used: toolchains.bootlin.com

Reference: https://github.com/diederikdehaas/rtl8812AU

[@nathanchance: Cherry-picked from 6c19878 and updated message]
Signed-off-by: Nathan Chancellor <[email protected]>
These warnings appear with GCC 7.3.0 from toolchains.bootlin.com:

../drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c: In function ‘mgt_dispatcher’:
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c:734:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
      ^
../drivers/net/wireless/realtek/rtl8192cu/core/rtw_mlme_ext.c:739:3: note: here
   case WIFI_ASSOCREQ:
   ^~~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c: In function ‘phy_TxPwrIdxToDbm’:
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c:2365:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   Offset = -8;
   ~~~~~~~^~~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c:2366:2: note: here
  default:
  ^~~~~~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c: In function ‘GetHwReg8192CU’:
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c:5694:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
    *((u16 *)(val)) = pHalData->BasicRateSet;
    ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c:5695:3: note: here
   case HW_VAR_TXPAUSE:
   ^~~~
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_linux.c: In function ‘set_group_key’:
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_linux.c:7383:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
    keylen = 16;
    ~~~~~~~^~~~
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_linux.c:7384:3: note: here
   default:
   ^~~~~~~
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_cfg80211.c: In function ‘set_group_key’:
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_cfg80211.c:822:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
    keylen = 16;
    ~~~~~~~^~~~
../drivers/net/wireless/realtek/rtl8192cu/os_dep/linux/ioctl_cfg80211.c:823:3: note: here
   default:
   ^~~~~~~

None of them appear to be a real issue but it is trivial to make the
warnings go away.

Signed-off-by: Nathan Chancellor <[email protected]>
@nathanchance nathanchance force-pushed the compilation-fixes-4.16 branch from 78c333a to 9bf6e54 Compare March 5, 2018 16:07
@pelwell pelwell merged commit 64e335b into raspberrypi:rpi-4.16.y Mar 13, 2018
@pelwell
Copy link
Contributor

pelwell commented Mar 13, 2018

Thank you.

@nathanchance nathanchance deleted the compilation-fixes-4.16 branch March 23, 2018 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants