diff mbox

[U-Boot,v2,3/6] common: make abortboot available for menu use

Message ID 1308853655-12407-4-git-send-email-jason.hobbs@calxeda.com
State Superseded
Headers show

Commit Message

Jason Hobbs June 23, 2011, 6:27 p.m. UTC
Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
---
changes in v2:
- expose abortboot externally instead of using a wrapper
- expose abortboot externally when CONFIG_MENU is set

 common/main.c    |   12 ++++++++----
 include/common.h |    3 +++
 2 files changed, 11 insertions(+), 4 deletions(-)

Comments

Mike Frysinger June 23, 2011, 10:59 p.m. UTC | #1
On Thursday, June 23, 2011 14:27:32 Jason Hobbs wrote:
> +#ifdef CONFIG_MENU
> +int abortboot(int bootdelay)
> +#else
>  static __inline__ int abortboot(int bootdelay)
> +#endif

more ifdef trickery here than necessary:
	#ifndef CONFIG_MENU
	static inline
	#endif
	int abortboot(int bootdelay)
	{
-mike
Wolfgang Denk June 24, 2011, 5:18 a.m. UTC | #2
Dear "Jason Hobbs",

In message <1308853655-12407-4-git-send-email-jason.hobbs@calxeda.com> you wrote:
> Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
> ---
> changes in v2:
> - expose abortboot externally instead of using a wrapper
> - expose abortboot externally when CONFIG_MENU is set
> 
>  common/main.c    |   12 ++++++++----
>  include/common.h |    3 +++
>  2 files changed, 11 insertions(+), 4 deletions(-)
...
> +#ifdef CONFIG_MENU

This being a new CONFIG_ variable, it must be documented in the
README.  But as is this makes little sense, so I suggest you change
the order of your patches and add the abortboot support to the menu
system in a second step, after adding (and documenting) the menu
stuff.


Best regards,

Wolfgang Denk
Jason Hobbs June 24, 2011, 8:38 p.m. UTC | #3
Mike,

On Thu, Jun 23, 2011 at 06:59:40PM -0400, Mike Frysinger wrote:
> more ifdef trickery here than necessary:
> 	#ifndef CONFIG_MENU
> 	static inline
> 	#endif
> 	int abortboot(int bootdelay)
> 	{

Thanks - I'll change this in the next version of the patch.

Jason
Jason Hobbs June 24, 2011, 8:42 p.m. UTC | #4
Dear Wolfgang,

On Fri, Jun 24, 2011 at 07:18:55AM +0200, Wolfgang Denk wrote:
> > +#ifdef CONFIG_MENU
> 
> This being a new CONFIG_ variable, it must be documented in the
> README.  But as is this makes little sense, so I suggest you change
> the order of your patches and add the abortboot support to the menu
> system in a second step, after adding (and documenting) the menu
> stuff.

I knew it wasn't right, but I didn't know what else to do. I'll follow
your suggestion in the next version of this patch series.

Thanks,
Jason
diff mbox

Patch

diff --git a/common/main.c b/common/main.c
index 1f64523..a031a33 100644
--- a/common/main.c
+++ b/common/main.c
@@ -56,10 +56,6 @@  void update_tftp (void);
 
 #define MAX_DELAY_STOP_STR 32
 
-#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
-static int abortboot(int);
-#endif
-
 #undef DEBUG_PARSER
 
 char        console_buffer[CONFIG_SYS_CBSIZE + 1];	/* console I/O buffer	*/
@@ -91,7 +87,11 @@  extern void mdm_init(void); /* defined in board.c */
  */
 #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
 # if defined(CONFIG_AUTOBOOT_KEYED)
+#ifdef CONFIG_MENU
+int abortboot(int bootdelay)
+#else
 static __inline__ int abortboot(int bootdelay)
+#endif
 {
 	int abort = 0;
 	uint64_t etime = endtick(bootdelay);
@@ -205,7 +205,11 @@  static __inline__ int abortboot(int bootdelay)
 static int menukey = 0;
 #endif
 
+#ifdef CONFIG_MENU
+int abortboot(int bootdelay)
+#else
 static __inline__ int abortboot(int bootdelay)
+#endif
 {
 	int abort = 0;
 
diff --git a/include/common.h b/include/common.h
index e659630..d8b8a79 100644
--- a/include/common.h
+++ b/include/common.h
@@ -234,6 +234,9 @@  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);
+#ifdef CONFIG_MENU
+int	abortboot(int bootdelay);
+#endif
 
 /* arch/$(ARCH)/lib/board.c */
 void	board_init_f  (ulong) __attribute__ ((noreturn));