diff mbox

[U-Boot,2/4] common: make abortboot available for pxecfg use

Message ID 1307386599-4256-3-git-send-email-jason.hobbs@calxeda.com
State Changes Requested
Headers show

Commit Message

Jason Hobbs June 6, 2011, 6:56 p.m. UTC
From: Rob Herring <rob.herring@calxeda.com>

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
---
 common/main.c    |    7 +++++++
 include/common.h |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

Comments

Wolfgang Denk June 6, 2011, 7:23 p.m. UTC | #1
Dear "Jason Hobbs",

In message <1307386599-4256-3-git-send-email-jason.hobbs@calxeda.com> you wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
> ---
>  common/main.c    |    7 +++++++
>  include/common.h |    1 +
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/common/main.c b/common/main.c
> index 7da6604..4185bfd 100644
> --- a/common/main.c
> +++ b/common/main.c
> @@ -263,6 +263,13 @@ static __inline__ int abortboot(int bootdelay)
>  # endif	/* CONFIG_AUTOBOOT_KEYED */
>  #endif	/* CONFIG_BOOTDELAY >= 0  */
>  
> +int _abortboot(int bootdelay)
> +{
> +#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
> +	return abortboot(bootdelay);
> +#endif
> +}
> +
>  /****************************************************************************/
>  
>  void main_loop (void)
> diff --git a/include/common.h b/include/common.h
> index e659630..fd389e7 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -234,6 +234,7 @@ int	readline_into_buffer	(const char *const prompt, char * buffer);
>  int	parse_line (char *, char *[]);
>  void	init_cmd_timeout(void);
>  void	reset_cmd_timeout(void);
> +int	_abortboot(int bootdelay);

Why do you make this a reserved identifier? (Quote standard: " All
identifiers that begin with an underscore and either an uppercase
letter or another underscore are always reserved for any use.").


Also, if this is needed for the PXE code, it should be part of the PXE
patch series.

Best regards,

Wolfgang Denk
Jason Hobbs June 6, 2011, 8:52 p.m. UTC | #2
Dear Wolfgang,

On Mon, Jun 06, 2011 at 09:23:06PM +0200, Wolfgang Denk wrote:
> > diff --git a/include/common.h b/include/common.h
> > index e659630..fd389e7 100644
> > --- a/include/common.h
> > +++ b/include/common.h
> > @@ -234,6 +234,7 @@ int	readline_into_buffer	(const char *const prompt, char * buffer);
> >  int	parse_line (char *, char *[]);
> >  void	init_cmd_timeout(void);
> >  void	reset_cmd_timeout(void);
> > +int	_abortboot(int bootdelay);
> 
> Why do you make this a reserved identifier? (Quote standard: " All
> identifiers that begin with an underscore and either an uppercase
> letter or another underscore are always reserved for any use.").

How about removing static __inline__ from abortboot's definition and
calling it directly from code external to main.c, getting rid of the
wrapper?
 
> Also, if this is needed for the PXE code, it should be part of the PXE
> patch series.

I submitted two patch series related to PXE today, but they are
independent abortboot is needed for the pxecfg code, but not for the
DHCP PXE options code.

Thanks,
Jason
Wolfgang Denk June 6, 2011, 9:20 p.m. UTC | #3
Dear "Jason Hobbs",

In message <20110606205226.GA3035@jhobbs-laptop> you wrote:
> Dear Wolfgang,
> 
> On Mon, Jun 06, 2011 at 09:23:06PM +0200, Wolfgang Denk wrote:
> > > diff --git a/include/common.h b/include/common.h
> > > index e659630..fd389e7 100644
> > > --- a/include/common.h
> > > +++ b/include/common.h
> > > @@ -234,6 +234,7 @@ int	readline_into_buffer	(const char *const prompt, char * buffer);
> > >  int	parse_line (char *, char *[]);
> > >  void	init_cmd_timeout(void);
> > >  void	reset_cmd_timeout(void);
> > > +int	_abortboot(int bootdelay);
> > 
> > Why do you make this a reserved identifier? (Quote standard: " All
> > identifiers that begin with an underscore and either an uppercase
> > letter or another underscore are always reserved for any use.").
> 
> How about removing static __inline__ from abortboot's definition and
> calling it directly from code external to main.c, getting rid of the
> wrapper?

This is probably OK - eventually we should do this only if the PXE
code gets included.

> > Also, if this is needed for the PXE code, it should be part of the PXE
> > patch series.
> 
> I submitted two patch series related to PXE today, but they are
> independent abortboot is needed for the pxecfg code, but not for the
> DHCP PXE options code.

I understood that when I actually read the other set of patches.
Please ignore this comment.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/common/main.c b/common/main.c
index 7da6604..4185bfd 100644
--- a/common/main.c
+++ b/common/main.c
@@ -263,6 +263,13 @@  static __inline__ int abortboot(int bootdelay)
 # endif	/* CONFIG_AUTOBOOT_KEYED */
 #endif	/* CONFIG_BOOTDELAY >= 0  */
 
+int _abortboot(int bootdelay)
+{
+#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
+	return abortboot(bootdelay);
+#endif
+}
+
 /****************************************************************************/
 
 void main_loop (void)
diff --git a/include/common.h b/include/common.h
index e659630..fd389e7 100644
--- a/include/common.h
+++ b/include/common.h
@@ -234,6 +234,7 @@  int	readline_into_buffer	(const char *const prompt, char * buffer);
 int	parse_line (char *, char *[]);
 void	init_cmd_timeout(void);
 void	reset_cmd_timeout(void);
+int	_abortboot(int bootdelay);
 
 /* arch/$(ARCH)/lib/board.c */
 void	board_init_f  (ulong) __attribute__ ((noreturn));