Re: [microblaze-linux] [PATCH 2/5] microblaze: s/#if[!]CONFIG/#if[n]def CONFIG/

From: Geert Uytterhoeven
Date: Mon Feb 20 2012 - 06:59:28 EST


On Mon, Feb 20, 2012 at 01:27, John Williams
<john.williams@xxxxxxxxxxxxx> wrote:
> NACK - please see comments below
>
> On Mon, Feb 20, 2012 at 1:11 AM, Geert Uytterhoeven
> <geert@xxxxxxxxxxxxxx> wrote:
>> Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
>> Cc: Michal Simek <monstr@xxxxxxxxx>
>> Cc: microblaze-uclinux@xxxxxxxxxxxxxx
>> ---
>> Âarch/microblaze/include/asm/exceptions.h | Â Â2 +-
>> Âarch/microblaze/include/asm/irqflags.h  |  Â2 +-
>> Âarch/microblaze/kernel/entry-nommu.S Â Â | Â Â2 +-
>> Âarch/microblaze/kernel/entry.S Â Â Â Â Â | Â Â4 ++--
>> Âarch/microblaze/kernel/setup.c      |  Â4 ++--
>> Â5 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/microblaze/include/asm/exceptions.h b/arch/microblaze/include/asm/exceptions.h
>> index e6a8dde..48c197b 100644
>> --- a/arch/microblaze/include/asm/exceptions.h
>> +++ b/arch/microblaze/include/asm/exceptions.h
>> @@ -25,7 +25,7 @@
>> Â/* Define MSR enable bit for HW exceptions */
>> Â#define HWEX_MSR_BIT (1 << 8)
>>
>> -#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
>> +#ifdef CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
>
> We actually care about the value of this one - it is always defined,
> but is either 0 or 1 depending upon the presence or absence of this
> feature in the target CPU.
>
> These CPU feature-related configs are defined in
> arch/microblaze/platform/generic/Kconfig.auto
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/microblaze/platform/generic/Kconfig.auto;h=25a6f019e94d5d9a1c884dfef9e906435685f980;hb=HEAD
>
> not as bools, but as integers. ÂKconfig.auto is actually a placeholder
> for a design file which is emitted from the MicroBlaze CPU / SoC
> design tool flow and copied into place by the user.
>
> In my view these should remain integers rather than booleans for a
> couple of reasons:
> Â* breakage for all current users
> Â* MicroBlaze is an evolving architecture, there are other cases of
> seemingly boolean HW parametesr growing to become integers, such as
> the USE_FPU option. ÂOnce upon a time it was yes/no, now there's 2
> different flavours of FPU as well as 'none'. ÂMSR is just as likely to
> change in future.
>
>> -#if CONFIG_MANUAL_RESET_VECTOR
>> +#ifdef CONFIG_MANUAL_RESET_VECTOR
>
> This guy is also always defined (Kconfig 'hex' type), we just need to
> do something different for a non-zero value.

Sorry, I missed these are not bool values.

To avoid this from happening again, perhaps it's a good idea to
explicitly write e.g.

#if CONFIG_MANUAL_RESET_VECTOR != 0

like is done for other int config values?

Gr{oetje,eeting}s,

            Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
             Â Â -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/