[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 2 Feb 2018 17:44:08 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Nicolas Pitre <nico@...aro.org>,
Andi Kleen <ak@...ux.intel.com>,
Babu Moger <babu.moger@...cle.com>,
Will Deacon <will.deacon@....com>,
stable <stable@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] Kbuild: always define endianess in kconfig.h
On Fri, Feb 2, 2018 at 5:31 PM, Masahiro Yamada
<yamada.masahiro@...ionext.com> wrote:
> 2018-02-03 0:40 GMT+09:00 Arnd Bergmann <arnd@...db.de>:
>> ---
>> include/linux/kconfig.h | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
>> index fec5076eda91..cc8fa109cfa3 100644
>> --- a/include/linux/kconfig.h
>> +++ b/include/linux/kconfig.h
>> @@ -4,6 +4,12 @@
>>
>> #include <generated/autoconf.h>
>>
>> +#ifdef CONFIG_CPU_BIG_ENDIAN
>> +#define __BIG_ENDIAN 4321
>> +#else
>> +#define __LITTLE_ENDIAN 1234
>> +#endif
>> +
>> #define __ARG_PLACEHOLDER_1 0,
>> #define __take_second_arg(__ignored, val, ...) val
>>
>> --
>> 2.9.0
>>
>
> If all architectures define
> CONFIG_CPU_BIG_ENDIAN or CONFIG_CPU_LITTLE_ENDIAN,
> is it possible to use this for endian test?
>
> i.e.
>
> Is it possible to replace like this?
> #ifdef __BIG_ENDIAN -> #ifdef CONFIG_CPU_BIG_ENDIAN
>
> #ifdef __LITTLE_ENDIAN -> #ifdef CONFIG_CPU_LITTLE_ENDIAN
I believe we don't always define CONFIG_CPU_LITTLE_ENDIAN,
but it would work in principle. The main issue here is changing so
many files:
$ git grep -wl '__\(BIG\|LITTLE\)_ENDIAN' | wc -l
418
$ git grep -wl 'CONFIG_CPU_\(BIG\|LITTLE\)_ENDIAN' | wc -l
145
Arnd
Powered by blists - more mailing lists