From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 21 Feb 2009 17:13:48 +0100 Subject: [U-Boot] [PATCH 1/1 V3] cmd_bdinfo: move implementation to arch instead of common In-Reply-To: <200902211107.20286.vapier@gentoo.org> References: <1235205980-20534-1-git-send-email-plagnioj@jcrosoft.com> <200902211107.20286.vapier@gentoo.org> Message-ID: <20090221161348.GA26207@game.jcrosoft.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 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.