From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Fri, 20 Jul 2012 00:20:16 -0400 Subject: [U-Boot] [PATCH 5/7] dfu:cmd: Support for DFU u-boot command In-Reply-To: <1341308291-14663-6-git-send-email-l.majewski@samsung.com> References: <1341308291-14663-1-git-send-email-l.majewski@samsung.com> <1341308291-14663-6-git-send-email-l.majewski@samsung.com> Message-ID: <201207200020.17935.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday 03 July 2012 05:38:09 Lukasz Majewski wrote: > --- /dev/null > +++ b/common/cmd_dfu.c > > +int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) static > +{ > + char *str_env = NULL, *env_bkp = NULL; no need to assign NULL here. str_env should be const. > + static char *s = "dfu"; no need to declare this static > + int ret = 0; no need to init to 0 > + env_bkp = strdup(str_env); > + ret = dfu_config_entities(env_bkp, argv[1], > + (int)simple_strtoul(argv[2], NULL, 10)); > + if (ret) > + return CMD_RET_FAILURE; > + > + if (strcmp(argv[3], "list") == 0) { > + dfu_show_entities(); > + dfu_free_entities(); > + free(env_bkp); > + return CMD_RET_SUCCESS; for these last three statements, you could just do "goto done" and put a done label below ... > +exit: > + g_dnl_cleanup(); done: > + dfu_free_entities(); > + free(env_bkp); > + > + return CMD_RET_SUCCESS; -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: