Message ID | CAK8P3a1WfU9V1k2r=TfJSVRTymuD8n2hkJDr6u1KcmC_scAZMA@mail.gmail.com |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
From: Arnd Bergmann <arnd@arndb.de> Date: Thu, 8 Jun 2017 10:01:59 +0200 > I would also suggest adding a sanity check like Hmm, but this will kill the build for non-fixed endian architectures won't it? -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Jun 8, 2017 at 4:02 PM, David Miller <davem@davemloft.net> wrote: > From: Arnd Bergmann <arnd@arndb.de> > Date: Thu, 8 Jun 2017 10:01:59 +0200 > >> I would also suggest adding a sanity check like > > Hmm, but this will kill the build for non-fixed endian architectures > won't it? I think only xtensa, all others already define CONFIG_CPU_BIG_ENDIAN conditionally, and include the right header depending on that. For xtensa, the decision is apparently made by the toolchain, and the kernel just detects the macros set by the compiler, but that is slightly fragile because it prevents us from making Kconfig decisions based on endianess. Arnd -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/linux/byteorder/big_endian.h b/include/linux/byteorder/big_endian.h index 392041475c72..18a1ab5b0260 100644 --- a/include/linux/byteorder/big_endian.h +++ b/include/linux/byteorder/big_endian.h @@ -3,5 +3,9 @@ #include <uapi/linux/byteorder/big_endian.h> +#ifndef CONFIG_CPU_BIG_ENDIAN +#warning inconsistent configuration, need CONFIG_CPU_BIG_ENDIAN +#endif + #include <linux/byteorder/generic.h> #endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */ diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h index 08057377aa23..ba910bb9aad0 100644 --- a/include/linux/byteorder/little_endian.h +++ b/include/linux/byteorder/little_endian.h @@ -3,5 +3,9 @@ #include <uapi/linux/byteorder/little_endian.h> +#ifdef CONFIG_CPU_BIG_ENDIAN +#warning inconsistent configuration, CONFIG_CPU_BIG_ENDIAN is set +#endif + #include <linux/byteorder/generic.h> #endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */