[U-Boot] [PATCH 1/1 V3] cmd_bdinfo: move implementation to arch instead of common

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sat Feb 21 17:13:48 CET 2009


On 11:07 Sat 21 Feb     , Mike Frysinger wrote:
> On Saturday 21 February 2009 03:46:20 Jean-Christophe PLAGNIOL-VILLARD wrote:
> > --- a/common/cmd_bdinfo.c
> > +++ b/common/cmd_bdinfo.c
> > +void board_bdinfo(cmd_tbl_t *, int, int, char **) __attribute__((weak));
> > +void cpu_bdinfo(cmd_tbl_t *, int, int, char **) __attribute__((weak));
> 
> since other people are expected to implement these functions, better to put 
> the prototype into a common header so that the implementation and the caller 
> agree on the function signature.  the compiler can check this way.
done in the bdinfo.h
but IIRC we specify it's weak here not in the header
> 
> > +int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> > +{
> > +	/* call arch bdinfo */
> > +	arch_bdinfo(cmdtp, flag, argc, argv);
> > +
> > +	/* call soc bdinfo */
> > +	if(cpu_bdinfo) {
> > +		printf("CPU Info\n");
> > +		cpu_bdinfo(cmdtp, flag, argc, argv);
> > +	}
> > +
> > +	/* call board bdinfo */
> > +	if(board_bdinfo) {
> > +		printf("Board Info\n");
> > +		board_bdinfo(cmdtp, flag, argc, argv);
> > +	}
> 
> there should be a space after that "if".  i would use "puts" instead of 
> "printf" since you arent using any format strings.
ok

Best Regards,
J.


More information about the U-Boot mailing list