fix MDK AC5 build warnings

This commit is contained in:
yangpeng 2024-02-04 10:20:18 +08:00 committed by Meco Man
parent d5e2df46e5
commit 25d3136d02
5 changed files with 11 additions and 8 deletions

View File

@ -35,7 +35,6 @@
extern int wifi_hw_init(void); extern int wifi_hw_init(void);
extern void wwd_thread_notify_irq(void); extern void wwd_thread_notify_irq(void);
static const struct fal_partition *partition = RT_NULL;
static rt_uint32_t init_flag = 0; static rt_uint32_t init_flag = 0;
struct rt_wlan_device *bcm_hw_wlan_dev_alloc(void) struct rt_wlan_device *bcm_hw_wlan_dev_alloc(void)

View File

@ -186,12 +186,13 @@ static int is_gpt_valid(struct rt_mmcsd_card *card, size_t lba, gpt_header **gpt
{ {
size_t lastlba; size_t lastlba;
if (!ptes) if (!ptes || !gpt)
{ {
return 0; return 0;
} }
if (!(*gpt = alloc_read_gpt_header(card, lba))) *gpt = alloc_read_gpt_header(card, lba);
if (!(*gpt))
{ {
return 0; return 0;
} }
@ -255,7 +256,8 @@ static int is_gpt_valid(struct rt_mmcsd_card *card, size_t lba, gpt_header **gpt
goto fail; goto fail;
} }
if (!(*ptes = alloc_read_gpt_entries(card, *gpt))) *ptes = alloc_read_gpt_entries(card, *gpt);
if (!(*ptes))
{ {
goto fail; goto fail;
} }

View File

@ -837,7 +837,7 @@ rt_wlan_mode_t rt_wlan_get_mode(const char *dev_name)
return mode; return mode;
} }
#ifdef RT_WLAN_JOIN_SCAN_BY_MGNT
static void rt_wlan_join_scan_callback(int event, struct rt_wlan_buff *buff, void *parameter) static void rt_wlan_join_scan_callback(int event, struct rt_wlan_buff *buff, void *parameter)
{ {
struct rt_wlan_info *info = RT_NULL; struct rt_wlan_info *info = RT_NULL;
@ -871,6 +871,7 @@ static void rt_wlan_join_scan_callback(int event, struct rt_wlan_buff *buff, voi
} }
} }
} }
#endif
rt_err_t rt_wlan_connect(const char *ssid, const char *password) rt_err_t rt_wlan_connect(const char *ssid, const char *password)
{ {

View File

@ -1083,7 +1083,6 @@ static int cmd_list(int argc, char **argv)
#endif /* RT_USING_DFS */ #endif /* RT_USING_DFS */
default: default:
goto _usage; goto _usage;
break;
}; };
return 0; return 0;

View File

@ -797,7 +797,8 @@ static msh_cmd_opt_t *msh_get_cmd_opt(char *opt_str)
char *ptr; char *ptr;
int len; int len;
if ((ptr = strchr(opt_str, ' '))) ptr = strchr(opt_str, ' ');
if (ptr)
{ {
len = ptr - opt_str; len = ptr - opt_str;
} }
@ -892,7 +893,8 @@ void msh_opt_auto_complete(char *prefix)
char *opt_str = RT_NULL; char *opt_str = RT_NULL;
msh_cmd_opt_t *opt = RT_NULL; msh_cmd_opt_t *opt = RT_NULL;
if ((argc = msh_get_argc(prefix, &opt_str))) argc = msh_get_argc(prefix, &opt_str);
if (argc)
{ {
opt = msh_get_cmd_opt(prefix); opt = msh_get_cmd_opt(prefix);
} }