tools/syscall: Resolve compile time warning on address validation.

The following warning is emitted when building with GCC 12.2.0:

"the comparison will always evaluate as ‘true’ for the address of ‘g_parm’ will never be NULL [-Waddress]"

As g_param is an array of char[]. each member should have an actual address, so the validation in each if statement is not required.
This commit is contained in:
Stuart Ianna 2023-05-19 09:48:39 +10:00 committed by Xiang Xiao
parent 160e1a965d
commit b9fa045427

View File

@ -208,7 +208,7 @@ static void generate_proxy(int nfixed, int nparms)
fprintf(stream, "#include <stdarg.h>\n");
}
if (g_parm[HEADER_INDEX] && strlen(g_parm[HEADER_INDEX]) > 0)
if (strlen(g_parm[HEADER_INDEX]) > 0)
{
fprintf(stream, "#include <%s>\n", g_parm[HEADER_INDEX]);
}
@ -429,7 +429,7 @@ static void generate_stub(int nfixed, int nparms)
fprintf(stream, "#include <nuttx/config.h>\n");
fprintf(stream, "#include <stdint.h>\n");
if (g_parm[HEADER_INDEX] && strlen(g_parm[HEADER_INDEX]) > 0)
if (strlen(g_parm[HEADER_INDEX]) > 0)
{
fprintf(stream, "#include <%s>\n", g_parm[HEADER_INDEX]);
}
@ -588,7 +588,7 @@ static void generate_wrapper(int nfixed, int nparms)
fprintf(stream, "#include <stdarg.h>\n");
}
if (g_parm[HEADER_INDEX] && strlen(g_parm[HEADER_INDEX]) > 0)
if (strlen(g_parm[HEADER_INDEX]) > 0)
{
fprintf(stream, "#include <%s>\n", g_parm[HEADER_INDEX]);
}