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

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to