This is an automated email from the ASF dual-hosted git repository.

casaroli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 4272a0571b75bb7192d2b8d7dbb6875893602828
Author: zhanghongyu <[email protected]>
AuthorDate: Mon Nov 2 15:42:59 2026 +0800

    drivers/net/wifi_sim.c: fix coding style violations
    
    tools/checkpatch.sh reports 21 nxstyle errors in this file:
    
      - wifi_chan_to_freq_mhz(): statements under the WLAN_80211_BAND_*
        case labels are indented 10 columns instead of 8
      - wifidriver_get_bssinfo(): the "default:" body is over-indented
      - wifidriver_get_encode_ext(): the if/else braces under
        case IW_MODE_INFRA are missing the 2-column indent
      - wifi_sim_remove(): wifidriver_start_disconnect() is indented one
        column too far
    
    Fix the indentation and add the blank lines between case blocks that the
    rest of the file already uses.  Whitespace only: the preprocessed token
    stream is unchanged.
    
    Signed-off-by: zhanghongyu <[email protected]>
---
 drivers/net/wifi_sim.c | 79 ++++++++++++++++++++++++++------------------------
 1 file changed, 41 insertions(+), 38 deletions(-)

diff --git a/drivers/net/wifi_sim.c b/drivers/net/wifi_sim.c
index 4c4d0d0b098..e83ecfac842 100644
--- a/drivers/net/wifi_sim.c
+++ b/drivers/net/wifi_sim.c
@@ -517,41 +517,44 @@ uint32_t wifi_chan_to_freq_mhz(int chan, enum 
WLAN_80211_BAND_E band)
   switch (band)
     {
       case WLAN_80211_BAND_2GHZ:
-          if (chan == 14)
-            {
-              return (2484);
-            }
-          else if (chan < 14)
-            {
-              return (2407 + chan * 5);
-            }
-          break;
+        if (chan == 14)
+          {
+            return (2484);
+          }
+        else if (chan < 14)
+          {
+            return (2407 + chan * 5);
+          }
+        break;
+
       case WLAN_80211_BAND_5GHZ:
-          if (chan >= 182 && chan <= 196)
-            {
-              return (4000 + chan * 5);
-            }
-          else
-            {
-              return (5000 + chan * 5);
-            }
-          break;
+        if (chan >= 182 && chan <= 196)
+          {
+            return (4000 + chan * 5);
+          }
+        else
+          {
+            return (5000 + chan * 5);
+          }
+        break;
+
       case WLAN_80211_BAND_6GHZ:
 
-          /* see 802.11ax D6.1 27.3.23.2 */
+        /* see 802.11ax D6.1 27.3.23.2 */
 
-          if (chan == 2)
-            {
-              return (5935);
-            }
+        if (chan == 2)
+          {
+            return (5935);
+          }
+
+        if (chan <= 233)
+          {
+            return (5950 + chan * 5);
+          }
+        break;
 
-          if (chan <= 233)
-            {
-              return (5950 + chan * 5);
-            }
-          break;
       default:
-          break;
+        break;
     }
 
   return 0; /* not supported */
@@ -1416,7 +1419,7 @@ static int wifidriver_get_bssinfo(FAR struct 
wifi_sim_bss_s *bss_info,
             break;
 
           default:
-              break;
+            break;
         }
     }
 
@@ -1756,15 +1759,15 @@ static int wifidriver_get_psk(FAR struct wifi_sim_s 
*wifidev,
       case IW_MODE_INFRA:
         size = strnlen(wifidev->password, 64);
         if (len < size)
-        {
-          return -EINVAL;
-        }
+          {
+            return -EINVAL;
+          }
         else
-        {
-          ext->key_len = size;
-          memcpy(ext->key, wifidev->password, ext->key_len);
-          ext->alg = wifidev->auth_alg;
-        }
+          {
+            ext->key_len = size;
+            memcpy(ext->key, wifidev->password, ext->key_len);
+            ext->alg = wifidev->auth_alg;
+          }
         break;
 
       case IW_MODE_MASTER:

Reply via email to