brcmfmac: sdio: Fix undefined behavior due to shift overflowing the constant
authorBorislav Petkov <bp@alien8.de>
Tue, 5 Apr 2022 16:55:37 +0000 (18:55 +0200)
committerKalle Valo <kvalo@kernel.org>
Sun, 10 Apr 2022 12:20:38 +0000 (15:20 +0300)
commit6fb3a5868b2117611f41e421e10e6a8c2a13039a
tree2088156daa896582e31fe1e4cc0087910acedc44
parentdbc2b1764734857d68425468ffa8486e97ab89df
brcmfmac: sdio: Fix undefined behavior due to shift overflowing the constant

Fix:

  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function â€˜brcmf_sdio_drivestrengthinit’:
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3798:2: error: case label does not reduce to an integer constant
    case SDIOD_DRVSTR_KEY(BRCM_CC_43143_CHIP_ID, 17):
    ^~~~
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3809:2: error: case label does not reduce to an integer constant
    case SDIOD_DRVSTR_KEY(BRCM_CC_43362_CHIP_ID, 13):
    ^~~~

See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory
details as to why it triggers with older gccs only.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Arend van Spriel <aspriel@gmail.com>
Cc: Franky Lin <franky.lin@broadcom.com>
Cc: Hante Meuleman <hante.meuleman@broadcom.com>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: brcm80211-dev-list.pdl@broadcom.com
Cc: netdev@vger.kernel.org
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/Ykx0iRlvtBnKqtbG@zn.tnic
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c