lkml.org 
[lkml]   [2007]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] at91 pm: Compilation fix for at91sam926x
Date
Am Freitag 10 August 2007 00:15 schrieb Ulf Samuelsson:
>
> > > +#if defined(CONFIG_ARCH_AT91RM9200)
> > > at91_sys_write(AT91_SDRAMC_SRR, 1); /*
> > > self-refresh mode */
>
> > Why don't use:
> > if (cpu_is_at91rm9200())
> > at91_sys_write(AT91_SDRAMC_SRR, 1);
>
> What is the benefit?
> Will the optimizer remove the code if the CPU is not the at91rm9200?

No, it won't. cpu_is_something() is intended for runtime decisions.
Remember that the purpose of this patch was to solve a compile time
issue (see subject). AT91_SDRAMC_SRR isn't defined properly for
non-9200 processors because they don't have that register. So we need
something like #ifdef to include this line only on 9200.

Hans
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-10 09:15    [W:0.068 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site