[U-Boot] [PATCH] bootstage: Fix build error for standalone API example

Simon Glass sjg at chromium.org
Sat Mar 24 00:04:07 CET 2012


Hi Anatolij,

On Fri, Mar 23, 2012 at 3:32 PM, Anatolij Gustschin <agust at denx.de> wrote:
> Hi Simon,
>
> On Mon, 19 Mar 2012 22:49:30 -0700
> Simon Glass <sjg at chromium.org> wrote:
>
>> This example doesn't have get_timer() defined, which causes build breakages.
>>
>> Add #ifdef guards to work around this.
>>
>> Signed-off-by: Simon Glass <sjg at chromium.org>
>> ---
>>  lib/time.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/lib/time.c b/lib/time.c
>> index 69edc3d..5f393c3 100644
>> --- a/lib/time.c
>> +++ b/lib/time.c
>> @@ -48,6 +48,7 @@ void mdelay(unsigned long msec)
>>               udelay(1000);
>>  }
>>
>> +#ifdef CONFIG_BOOTSTAGE
>>  ulong __timer_get_boot_us(void)
>>  {
>>       static ulong base_time;
>> @@ -64,3 +65,4 @@ ulong __timer_get_boot_us(void)
>>
>>  ulong timer_get_boot_us(void)
>>       __attribute__((weak, alias("__timer_get_boot_us")));
>> +#endif
>
> Isn't it better to move timer_get_boot_us() to common/bootstage.c ?
> Or is there a plan to use this function not only in bootstage code?

Yes I sent through the smallest fix.

But as I said in the patch thread I am not sure which is best.

I'm happy to do it either way, so let me know and I can do a patch the
other way.

Regards,
Simon

>
> Thanks,
> Anatolij


More information about the U-Boot mailing list