[U-Boot] [PATCH 5/7] dfu:cmd: Support for DFU u-boot command

Lukasz Majewski l.majewski at samsung.com
Wed Jul 4 11:28:46 CEST 2012


Hi Marek,

> Dear Lukasz Majewski,
> 
> > Support for u-boot's command line command "dfu <interface> <dev>
> > [list]".
> > 
> > Signed-off-by: Lukasz Majewski <l.majewski at samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> > Cc: Marek Vasut <marex at denx.de>
> > ---
> 
> [...]
> 
> > +int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const
> > argv[]) +{
> > +	char *str_env = NULL, *env_bkp = NULL;
> > +	static char *s = "dfu";
> > +	int ret = 0;
> > +
> > +	if (argc < 3)
> > +		return CMD_RET_USAGE;
> > +
> > +	str_env = getenv("dfu_alt_info");
> > +	if (str_env == NULL) {
> > +		printf("%s: \"dfu_alt_info\" env variable not
> > defined!\n",
> > +		       __func__);
> 
> I was always curious if it's not possible to do something like 
> 
> puts(__func__ "rest of string");
> 
> Maybe it'd help the overhead a bit? Certainly, it's beyond the scope
> of this patchset, I'm just curious :)

It is a good idea, since many error/info messages are supposed to
produce following output:

"dfu_write: Not enough space!"

Putting there the __func__ name would improve structure and speed up
finding right place.

> 
> > +		return CMD_RET_FAILURE;
> > +	}
> 
> [...]
> 
> Best regards,
> Marek Vasut



-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group


More information about the U-Boot mailing list