anchao commented on a change in pull request #5696:
URL: https://github.com/apache/incubator-nuttx/pull/5696#discussion_r821874741



##########
File path: libs/libc/symtab/symtab_allsyms.c
##########
@@ -58,13 +58,16 @@ allsyms_lookup(FAR const char *name, FAR void *value,
       symbol = symtab_findbyvalue(g_allsyms, value, g_nallsyms);
     }
 
-  if (symbol && symbol != &g_allsyms[g_nallsyms - 1])
+  if (size)

Review comment:
       How about keep this style ? since there are other places in this file 
that do not use NULL checking 

##########
File path: libs/libc/symtab/symtab_allsyms.c
##########
@@ -58,13 +58,16 @@ allsyms_lookup(FAR const char *name, FAR void *value,
       symbol = symtab_findbyvalue(g_allsyms, value, g_nallsyms);
     }
 
-  if (symbol && symbol != &g_allsyms[g_nallsyms - 1])
+  if (size)
     {
-      *size = (symbol + 1)->sym_value - symbol->sym_value;
-    }
-  else
-    {
-      *size = 0;
+      if (symbol && symbol != &g_allsyms[g_nallsyms - 1])

Review comment:
       How about keep this style ? since there are other places in this file 
that do not use NULL checking 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to