[PATCH 1/2] Enable a way to provide the reason for "being here"
Juergen Beisert
jbe at pengutronix.de
Wed Jun 20 11:08:52 EDT 2012
Marc Kleine-Budde wrote:
> [...]
> > +
> > +#include <common.h>
> > +#include <init.h>
> > +#include <environment.h>
> > +#include <globalvar.h>
> > +#include <reset_source.h>
> > +
> > +static const char name[] = "global.system.reset";
> > +static const char unknown_reset[] = "unknown";
> > +static const char power_on_reset[] = "POR";
> > +static const char manual_reset[] = "RST";
> > +static const char watchdog[] = "WDG";
> > +static const char wake[] = "WKE";
> > +static const char jtag[] = "JTAG";
>
> what about using an array
>
> static cost char *reset_reason_array[] = {
> [RESET_UKWN] = "unknown",
> ...
> };
The result is not the same. The strings are no longer "const". But it should
not make a difference from the point of view of a possible reader. Will
change it.
> [...]
jbe
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | http://www.pengutronix.de/ |
More information about the barebox
mailing list