From a206d37a9329f9f048b465eff19139ed3e79aa23 Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Wed, 19 Apr 2023 10:07:53 +0800 Subject: [PATCH] mxm_wifiex: fix mxm5x17391 release build error and warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename README_MLAN to README in Makefile, otherwise it will build break becasue cannot find README_MLAN any more. Also, fix the following build warnings on ARM32 and ARM64 platforms. In file included from ./include/linux/kernel.h:29, from /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.h:37, from /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.h:26, from /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c:23: /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c: In function ‘woal_cfg80211_subcmd_rtt_range_request’: ./include/linux/kern_levels.h:5:25: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘unsigned int’ [-Wformat=] 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ | ^~~~~~ ./include/linux/printk.h:429:25: note: in definition of macro ‘printk_index_wrap’ 429 | _p_func(_fmt, ##__VA_ARGS__); \ | ^~~~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.h:3167:25: note: in expansion of macro ‘printk’ 3167 | printk(KERN_ERR msg); \ | ^~~~~~ ./include/linux/kern_levels.h:11:25: note: in expansion of macro ‘KERN_SOH’ 11 | #define KERN_ERR KERN_SOH "3" /* error conditions */ | ^~~~~~~~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.h:3167:32: note: in expansion of macro ‘KERN_ERR’ 3167 | printk(KERN_ERR msg); \ | ^~~~~~~~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.h:3186:31: note: in expansion of macro ‘PRINTM_MERROR’ 3186 | #define PRINTM(level, msg...) PRINTM_##level(level, msg) | ^~~~~~~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c:4351:17: note: in expansion of macro ‘PRINTM’ 4351 | PRINTM(MERROR, "%s: invalid %d(total) != %d(num) * %lu(each)\n", | ^~~~~~ /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_init.c: In function ‘parse_line_read_card_info’: /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_init.c:556:37: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘p + 1’ must not be NULL [-Waddress] 556 |         if ((p != NULL) && ((p + 1) != NULL)) {      |                                     ^~ Signed-off-by: Sherry Sun --- mxm_wifiex/wlan_src/Makefile | 4 ++-- mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c | 8 ++++---- mxm_wifiex/wlan_src/mlinux/moal_init.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mxm_wifiex/wlan_src/Makefile b/mxm_wifiex/wlan_src/Makefile index b4dcc3c..ab791cd 100644 --- a/mxm_wifiex/wlan_src/Makefile +++ b/mxm_wifiex/wlan_src/Makefile @@ -659,7 +659,7 @@ appsbuild: mkdir $(BINDIR); \ fi - cp -f README_MLAN $(BINDIR) + cp -f README $(BINDIR) ifneq ($(APPDIR),) cp -rf mapp/mlanconfig/config $(BINDIR) @@ -678,7 +678,7 @@ build: echo default cp -rpf script/load $(BINDIR)/ cp -rpf script/unload $(BINDIR)/ - cp -f README_MLAN $(BINDIR) + cp -f README $(BINDIR) ifneq ($(APPDIR),) cp -rf mapp/mlanconfig/config $(BINDIR) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c index 3a01621..aa31346 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211_util.c @@ -4348,9 +4348,9 @@ static int woal_cfg80211_subcmd_rtt_range_request(struct wiphy *wiphy, } if (nla_len(tb[ATTR_RTT_TARGET_CONFIG]) != sizeof(rtt_params.rtt_config[0]) * rtt_config_num) { - PRINTM(MERROR, "%s: invalid %d(total) != %d(num) * %lu(each)\n", + PRINTM(MERROR, "%s: invalid %d(total) != %d(num) * %u(each)\n", __func__, nla_len(tb[ATTR_RTT_TARGET_CONFIG]), - rtt_config_num, sizeof(rtt_params.rtt_config[0])); + rtt_config_num, (t_u32)sizeof(rtt_params.rtt_config[0])); err = -EINVAL; goto done; } @@ -4463,9 +4463,9 @@ static int woal_cfg80211_subcmd_rtt_range_cancel(struct wiphy *wiphy, if ((target_num <= 0 || target_num > MAX_RTT_CONFIG_NUM) || (nla_len(tb[ATTR_RTT_TARGET_ADDR]) != sizeof(t_u8) * MLAN_MAC_ADDR_LENGTH * target_num)) { - PRINTM(MERROR, "%s: Check if %din[1-%d] or %d*%lu=%d\n", + PRINTM(MERROR, "%s: Check if %din[1-%d] or %d*%u=%d\n", __func__, target_num, MAX_RTT_CONFIG_NUM, target_num, - sizeof(t_u8) * MLAN_MAC_ADDR_LENGTH, + (t_u32)(sizeof(t_u8) * MLAN_MAC_ADDR_LENGTH), nla_len(tb[ATTR_RTT_TARGET_ADDR])); err = -EINVAL; goto done; diff --git a/mxm_wifiex/wlan_src/mlinux/moal_init.c b/mxm_wifiex/wlan_src/mlinux/moal_init.c index 71b087f..0ce0adb 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_init.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_init.c @@ -553,7 +553,7 @@ static mlan_status parse_line_read_card_info(t_u8 *line, char **type, *p = '\0'; p = strstr(line, "_"); - if ((p != NULL) && ((p + 1) != NULL)) { + if (p != NULL) { *p++ = '\0'; *if_id = p; } else {