[PATCH 4/7] bootwrapper: add a fatal error helper
David Gibson
david at gibson.dropbear.id.au
Tue Mar 20 11:38:47 EST 2007
On Mon, Mar 19, 2007 at 02:58:03PM -0600, Milton Miller wrote:
> Add a macro fatal that calls printf then exit. User must include stdio.h.
>
> Typically replaces 3 lines with 1, although I added back some whitespace.
>
> Signed-off-by: Milton Miller <miltonm at bga.com>
One tiny nit...
[snip]
> Index: kernel/arch/powerpc/boot/ops.h
> ===================================================================
> --- kernel.orig/arch/powerpc/boot/ops.h 2007-03-19 08:32:50.000000000 -0500
> +++ kernel/arch/powerpc/boot/ops.h 2007-03-19 08:33:02.000000000 -0500
> @@ -157,6 +157,8 @@ static inline void exit(void)
> platform_ops.exit();
> for(;;);
> }
> +#define fatal(args...) { printf(args); exit(); }
> +
This is the old gcc way of doing a varargs macro, not the new C99
way. The new way would be:
#define fata(...) { printf(__VA_ARGS__); exit(); }
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
More information about the Linuxppc-dev
mailing list