lkml.org 
[lkml]   [2012]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] arm: Fix linux-next compile error in arch/arm/common/gic.c
On Tue, Jan 3, 2012 at 12:33 AM, Joerg Roedel <joerg.roedel@amd.com> wrote:
> With CONFIG_SMP=n the following compile error occurs:
>
>  CC      arch/arm/common/gic.o
> arch/arm/common/gic.c: In function 'gic_init_bases':
> arch/arm/common/gic.c:679:4: error: implicit declaration of function 'cpu_logical_map' [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
>
> This patch fixes the problem.
>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> ---
>  arch/arm/common/gic.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
> index b2dc2dd..b33f6b0 100644
> --- a/arch/arm/common/gic.c
> +++ b/arch/arm/common/gic.c
> @@ -676,7 +676,10 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
>                }
>
>                for_each_possible_cpu(cpu) {
> -                       unsigned long offset = percpu_offset * cpu_logical_map(cpu);
> +                       unsigned long offset = percpu_offset;
> +#ifdef CONFIG_SMP
> +                       offset *= cpu_logical_map(cpu);
> +#endif
>                        *per_cpu_ptr(gic->dist_base.percpu_base, cpu) = dist_base + offset;
>                        *per_cpu_ptr(gic->cpu_base.percpu_base, cpu) = cpu_base + offset;
>                }
> --
> 1.7.5.4
>
>

Is this the right way to fix it? Or shall we do like this:

#ifdef CONFIG_SMP
...
#else
#define cpu_logical_map() 1
#endif

and leave the gic.c code unchanged.

Thanks,
Yang
--
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: 2012-01-03 01:47    [W:0.072 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site