You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/05/15 10:56:10 UTC

[incubator-nuttx] 05/06: tools/nxstyle: Add kbps to the while suffix list

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

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

commit f905563cc9f5d05a67e30c52520c4f83e0a44c0f
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri May 13 20:31:29 2022 +0800

    tools/nxstyle: Add kbps to the while suffix list
    
    and correct offset by 1 error
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 tools/nxstyle.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/nxstyle.c b/tools/nxstyle.c
index 0c19c5e0b1..a13673d40b 100644
--- a/tools/nxstyle.c
+++ b/tools/nxstyle.c
@@ -211,8 +211,11 @@ static const char *g_white_prefix[] =
 
 static const char *g_white_suffix[] =
 {
-  "kHz",
+  /* Ref:  include/nuttx/wireless/nrf24l01.h */
+
   "Mbps",
+  "kHz",
+  "kbps",
   "us",
   NULL
 };
@@ -738,7 +741,7 @@ static bool white_list(const char *ident, int lineno)
     }
 
   len2 = strlen(ident);
-  while (!isalnum(ident[len2]))
+  while (!isalnum(ident[len2 - 1]))
     {
       len2--;
     }