From f905563cc9f5d05a67e30c52520c4f83e0a44c0f Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 13 May 2022 20:31:29 +0800 Subject: [PATCH] tools/nxstyle: Add kbps to the while suffix list and correct offset by 1 error Signed-off-by: Xiang Xiao --- 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--; }