Re: [PATCH for review] [3/145] i386: Allow to use GENERICARCH for UP kernels

Dave Hansen
2006-08-10T19:48:52Z

On Thu, 2006-08-10 at 21:35 +0200, Andi Kleen wrote:
> --- linux.orig/include/asm-i386/mach-summit/mach_apic.h
> +++ linux/include/asm-i386/mach-summit/mach_apic.h
> @@ -46,10 +46,12 @@ extern u8 cpu_2_logical_apicid[];
> static inline void init_apic_ldr(void)
> {
> unsigned long val, id;
> - int i, count;
> - u8 lid;
> + int count = 0;
> u8 my_id = (u8)hard_smp_processor_id();
> u8 my_cluster = (u8)apicid_cluster(my_id);
> +#ifdef CONFIG_SMP
> + u8 lid;
> + int i;
>
> /* Create logical APIC IDs by counting CPUs already in cluster. */
> for (count = 0, i = NR_CPUS; --i >= 0; ) {
> @@ -57,6 +59,7 @@ static inline void init_apic_ldr(void)
> if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster)
> ++count;
> }
> +#endif

Why does this particular loop have to go? I'm sure it's OK, but I also
wonder if there is a nice way to do it without the #ifdef.

-- Dave