You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/30 08:48:53 UTC

[GitHub] [incubator-nuttx-apps] XinStellaris commented on a change in pull request #1111: apps/nsh:add resetcause command

XinStellaris commented on a change in pull request #1111:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1111#discussion_r838286894



##########
File path: nshlib/nsh_syscmds.c
##########
@@ -518,3 +518,21 @@ int cmd_uname(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
   return OK;
 }
 #endif
+
+#if defined(CONFIG_BOARDCTL_RESET_CAUSE) && !defined(CONFIG_NSH_DISABLE_RESET_CAUSE)
+int cmd_reset_cause(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
+{
+  int ret;
+  struct boardioc_reset_cause_s cause;
+  memset(&cause, 0, sizeof(cause));

Review comment:
       I dont get it.cause is an instance of struct boardioc_reset_cause_s, and some struct members are not used in some cases. 
   Shouldn't I memset it to 0 to avoid uninitialized value ?




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org