Browse Source

fix MDK AC5 build warnings

yangpeng 1 year ago
parent
commit
25d3136d02

+ 0 - 1
bsp/stm32/stm32l475-atk-pandora/board/ports/wlan/drv_wlan.c

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

+ 5 - 3
components/drivers/sdio/gpt.c

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

+ 2 - 1
components/drivers/wlan/wlan_mgnt.c

@@ -837,7 +837,7 @@ rt_wlan_mode_t rt_wlan_get_mode(const char *dev_name)
     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)
 {
     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)
 {

+ 0 - 1
components/finsh/cmd.c

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

+ 4 - 2
components/finsh/msh.c

@@ -797,7 +797,8 @@ static msh_cmd_opt_t *msh_get_cmd_opt(char *opt_str)
     char *ptr;
     int len;
 
-    if ((ptr = strchr(opt_str, ' ')))
+    ptr = strchr(opt_str, ' ');
+    if (ptr)
     {
         len = ptr - opt_str;
     }
@@ -892,7 +893,8 @@ void msh_opt_auto_complete(char *prefix)
     char *opt_str = 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);
     }