Mirror of the source of what appears to be the driver for the GlobalScale Mochabin Wi-Fi 6 card, based on NXP 9098 - Other remote: https://github.com/nxp-imx/mwifiex
Go to file
Sherry Sun 6620b8524b mxm_wifiex: avoid the array-bounds build warnings on L5.17
When build the wifi driver based on L5.17 kernel, we may meet the
following build warnings. Add Wno-array-bounds cc-flags to avoid it.

/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c: In function ‘woal_host_mlme_disconnect’:
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9127:13: warning: array subscript ‘struct ieee80211_mgmt[0]’ is partly outside array bounds of ‘t_u8[26]’ {aka ‘unsigned char[26]’} [-Warray-bounds]
 9127 |         mgmt->frame_control = (__force __le16)IEEE80211_STYPE_DEAUTH;
      |             ^~
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9123:14: note: while referencing ‘frame_buf’
 9123 |         t_u8 frame_buf[26];
      |              ^~~~~~~~~
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9128:13: warning: array subscript ‘struct ieee80211_mgmt[0]’ is partly outside array bounds of ‘t_u8[26]’ {aka ‘unsigned char[26]’} [-Warray-bounds]
 9128 |         mgmt->duration = 0;
      |             ^~
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9123:14: note: while referencing ‘frame_buf’
 9123 |         t_u8 frame_buf[26];
      |              ^~~~~~~~~
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9129:13: warning: array subscript ‘struct ieee80211_mgmt[0]’ is partly outside array bounds of ‘t_u8[26]’ {aka ‘unsigned char[26]’} [-Warray-bounds]
 9129 |         mgmt->seq_ctrl = 0;
      |             ^~
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9123:14: note: while referencing ‘frame_buf’
 9123 |         t_u8 frame_buf[26];
      |              ^~~~~~~~~
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9130:13: warning: array subscript ‘struct ieee80211_mgmt[0]’ is partly outside array bounds of ‘t_u8[26]’ {aka ‘unsigned char[26]’} [-Warray-bounds]
 9130 |         mgmt->u.deauth.reason_code = (__force __le16)reason_code;
      |             ^~
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:9123:14: note: while referencing ‘frame_buf’
 9123 |         t_u8 frame_buf[26];
      |              ^~~~~~~~~

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Approved-by: Tian Yang <yang.tian@nxp.com>
2022-04-11 12:34:28 +08:00
mxm_wifiex/wlan_src mxm_wifiex: avoid the array-bounds build warnings on L5.17 2022-04-11 12:34:28 +08:00