fix: 编码规范问题修复

1.拼写错误
2.指针判空
3.函数返回值处理

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I8fad28051cab6d99357ffbb29aa0720235ecf502
This commit is contained in:
zhushengle
2022-03-21 14:24:41 +08:00
parent 174db030a4
commit f60bc94cf2
25 changed files with 247 additions and 188 deletions

View File

@@ -62,7 +62,7 @@ extern "C" {
* @param level [IN] print level.
* @param func [IN] means which func calls print func.
* @param line [IN] means which line calls print func.
* @param fmt [IN] other infomation by user define.
* @param fmt [IN] other information by user define.
* @param ap [IN] the para list.
*
* @retval None.
@@ -85,7 +85,7 @@ typedef VOID (*LK_FUNC)(INT32 level, const CHAR *func, INT32 line, const CHAR *f
* @param level [IN] print level.
* @param func [IN] means which func calls print func.
* @param line [IN] means which line calls print func.
* @param fmt [IN] other infomation by user define
* @param fmt [IN] other information by user define
*
* @retval NONE
* @par Dependency:

View File

@@ -424,7 +424,7 @@ STATIC INT32 OsTabMatchFile(CHAR *cmdKey, UINT32 *len)
* Description: Pass in the string and clear useless space, which include:
* 1) The overmatch space which is not be marked by Quote's area
* Squeeze the overmatch space into one space
* 2) Clear all space before first valid charatctor
* 2) Clear all space before first valid character
* Input: cmdKey : Pass in the buff string, which is ready to be operated
* cmdOut : Pass out the buffer string ,which has already been operated
* size : cmdKey length
@@ -452,17 +452,17 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsCmdKeyShift(const CHAR *cmdKey, CHAR *cmdOut, UI
}
/* Backup the 'output' start address */
outputBak = output;
/* Scan each charactor in 'cmdKey',and squeeze the overmuch space and ignore invalid charactor */
/* Scan each character in 'cmdKey',and squeeze the overmuch space and ignore invalid character */
for (; *cmdKey != '\0'; cmdKey++) {
/* Detected a Double Quotes, switch the matching status */
if (*(cmdKey) == '\"') {
SWITCH_QUOTES_STATUS(quotes);
}
/* Ignore the current charactor in following situation */
/* Ignore the current character in following situation */
/* 1) Quotes matching status is FALSE (which said that the space is not been marked by double quotes) */
/* 2) Current charactor is a space */
/* 3) Next charactor is a space too, or the string is been seeked to the end already(\0) */
/* 4) Invalid charactor, such as single quotes */
/* 2) Current character is a space */
/* 3) Next character is a space too, or the string is been seeked to the end already(\0) */
/* 4) Invalid character, such as single quotes */
if ((*cmdKey == ' ') && ((*(cmdKey + 1) == ' ') || (*(cmdKey + 1) == '\0')) && QUOTES_STATUS_CLOSE(quotes)) {
continue;
}
@@ -476,7 +476,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsCmdKeyShift(const CHAR *cmdKey, CHAR *cmdOut, UI
/* Restore the 'output' start address */
output = outputBak;
len = strlen(output);
/* Clear the space which is located at the first charactor in buffer */
/* Clear the space which is located at the first character in buffer */
if (*outputBak == ' ') {
output++;
len--;

View File

@@ -106,7 +106,7 @@ VOID OsLkLogFileSet(const CHAR *str)
}
fp = fopen(str, "w+");
if (fp == NULL) {
printf("Error can't open the %s file\n",str);
printf("Error can't open the %s file\n", str);
return;
}

View File

@@ -250,7 +250,7 @@ STATIC UINT32 ShellMsgNameGetAndExec(CmdParsed *cmdParsed, const CHAR *output, U
continue;
}
/* If detected a space which the quotes matching status is false */
/* which said has detected the first space for seperator, finish this scan operation */
/* which said has detected the first space for separator, finish this scan operation */
if ((*tmpStr == ' ') && (QUOTES_STATUS_CLOSE(quotes))) {
break;
}

View File

@@ -74,7 +74,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdHwi(INT32 argc, const CHAR **argv)
}
/* Different cores has different hwi form implementation */
if (HWI_IS_REGISTED(i)) {
PRINTK(" %10d:%11u%11llu", i, count, cycles);
PRINTK(" %10u:%11u%11llu", i, count, cycles);
} else {
continue;
}