[U-Boot] [PATCH 2/7] Add macros for recording init calls during UBoot execution

Andrew Murray amurray at theiet.org
Thu Sep 1 01:40:08 CEST 2011


On 31 August 2011 23:50, Mike Frysinger <vapier at gentoo.org> wrote:
> On Wednesday, August 31, 2011 18:20:56 Andrew Murray wrote:
>> +#if defined(CONFIG_BOOT_TRACE)
>> +#define DO_INITCALL(x, ...) \
>> +     do { \
>> +             printf("calling  0x%pF\n", x); \
>> +             (x)(__VA_ARGS__); \
>> +             printf("initcall 0x%pF returned\n", x); \
>> +     } while (0)
>
> are there any void initcalls ?  or just ones where you ignore the value ?
> otherwise we can simply rename DO_INITCALL_RET() to DO_INITCALL().

I guess it depends what you define as an initcall. A lot of functions
called during startup (e.g. arch/arm/lib/board.c) return int and in
most cases that value is ignored - but there are occasions where void
is returned - e.g. env_relocate.

For simplicity you could limit the use cases for this macro to those
which just return int and take your proposed approach?

Andrew Murray


More information about the U-Boot mailing list