mirror of
https://github.com/nxp-imx/mwifiex.git
synced 2025-01-15 16:25:35 +00:00
mwifiex: 8997: fix the build warning
Fix below build warning: mlnux/moal_cfg80211.h:464:29: warning: large integer implicitly truncated to unsigned type [-Woverflow] #define REGULATORY_CFG_LEN (NL80211_MAX_SUPP_REG_RULES << 1) ^ mlinux/moal_sta_cfg80211.c:7711:42: note: in expansion of macro ‘REGULATORY_CFG_LEN’ misc->param.custom_reg_domain.cfg_len = REGULATORY_CFG_LEN; mlinux/moal_eth_ioctl.c: In function ‘woal_priv_set_get_scancfg’: mlinux/moal_eth_ioctl.c:4144:2: warning: ISO C90 forbids variable length array ‘data’ [-Wvla] int data[arg_len]; ^ CC [M] mlinux/moal_priv.o mlinux/moal_priv.c: In function ‘woal_set_get_scan_cfg’: mlinux/moal_priv.c:4818:2: warning: ISO C90 forbids variable length array ‘data’ [-Wvla] int data[arg_len], copy_len; ^ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
This commit is contained in:
parent
280b53192f
commit
a248256620
4 changed files with 9 additions and 7 deletions
|
@ -1214,7 +1214,7 @@ typedef struct _mlan_ds_bss {
|
|||
|
||||
/** Type definition of mlan_ds_custom_reg_domain */
|
||||
typedef struct _mlan_ds_custom_reg_domain {
|
||||
t_u8 cfg_len;
|
||||
t_u16 cfg_len;
|
||||
t_u8 cfg_buf[0];
|
||||
} mlan_ds_custom_reg_domain;
|
||||
/*-----------------------------------------------------------------*/
|
||||
|
|
|
@ -1214,7 +1214,7 @@ typedef struct _mlan_ds_bss {
|
|||
|
||||
/** Type definition of mlan_ds_custom_reg_domain */
|
||||
typedef struct _mlan_ds_custom_reg_domain {
|
||||
t_u8 cfg_len;
|
||||
t_u16 cfg_len;
|
||||
t_u8 cfg_buf[0];
|
||||
} mlan_ds_custom_reg_domain;
|
||||
/*-----------------------------------------------------------------*/
|
||||
|
|
|
@ -4135,13 +4135,15 @@ done:
|
|||
*
|
||||
* @return 0 --success, otherwise fail
|
||||
*/
|
||||
|
||||
#define CMD_SCANCFG_DATA_LEN 8
|
||||
int
|
||||
woal_priv_set_get_scancfg(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
|
||||
{
|
||||
int ret = 0;
|
||||
int user_data_len = 0;
|
||||
int arg_len = 8;
|
||||
int data[arg_len];
|
||||
#define CMD_SCANCFG_DATA_LEN 8
|
||||
int data[CMD_SCANCFG_DATA_LEN];
|
||||
mlan_ds_scan *scan = NULL;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
|
|
|
@ -4814,8 +4814,8 @@ static int
|
|||
woal_set_get_scan_cfg(moal_private *priv, struct iwreq *wrq)
|
||||
{
|
||||
int ret = 0;
|
||||
int arg_len = 7;
|
||||
int data[arg_len], copy_len;
|
||||
#define WOAL_SCAN_CFG_DATA_LEN 7
|
||||
int data[WOAL_SCAN_CFG_DATA_LEN], copy_len;
|
||||
mlan_ds_scan *scan = NULL;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
int data_length = wrq->u.data.length;
|
||||
|
@ -4828,7 +4828,7 @@ woal_set_get_scan_cfg(moal_private *priv, struct iwreq *wrq)
|
|||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
if (data_length > arg_len) {
|
||||
if (data_length > WOAL_SCAN_CFG_DATA_LEN) {
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue