tools/nxstyle: Add kbps to the while suffix list

and correct offset by 1 error

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-05-13 20:31:29 +08:00 committed by Petro Karashchenko
parent 2976accd9f
commit f905563cc9

View File

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