[U-Boot] [PATCH] make hang() a weak function

Wolfgang Denk
2013-04-16T16:00:13Z

Dear Andreas,

In message <516D6F71.8090304@gmail.com> you wrote:
>
> You say (or at least I understand you so), that I have to hack all these
> places with some application specific stuff to inform the user of the
> device that we will stop processing now. Why don't we add an interface
> to easily change the behavior of hang application specific.

Because hang() is a trivial function that does just what the name
says. If you don't want this, then don't use this. If you need
additional functionality, then use a function that provides such.

> > Keep in mind that you
> > don't have to define CONFIG_PANIC_HANG.
>
> Thats true, but in some cases we just want to hang on panic.

Indeed. Normally this is the most useful thing to do.

> > Also, as done in arch/powerpc/lib/board.c we usually print an error
> > message on the console device, and we can call bootstage_error(),
> > which could initialte such actions.
>
> Ahhh ... I got it. So this is the interface I want! All we need is
> bootstage_error() in all hang() variants and thats it.

As you have to touch all these places anyway, please rather move
hang() out of all architecture specific code and place it in the
global lib/.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Misquotation is, in fact, the pride and privilege of the learned. A
widely-read man never quotes accurately, for the rather obvious
reason that he has read too widely.
- Hesketh Pearson _Common Misquotations_ introduction