]> git.baikalelectronics.ru Git - kernel.git/commit
locking/qrwlock: include asm/byteorder.h as needed
authorArnd Bergmann <arnd@arndb.de>
Fri, 2 Feb 2018 15:40:44 +0000 (16:40 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 6 Feb 2018 09:28:58 +0000 (10:28 +0100)
commitd906f543539f214a6a04a209972e453c0613d055
treef138fd92799bd943d945e7dad9ea8ae394bbf5e6
parent4991857580b408b862bcb0dcc346febf363781d8
locking/qrwlock: include asm/byteorder.h as needed

Moving the qrwlock struct definition into a header file introduced
a subtle bug on all little-endian machines, where some files in some
configurations would see the fields in an incorrect order.  This was
found by building with an LTO enabled compiler that warns every time we
try to link together files with incompatible data structures.

A second patch changes linux/kconfig.h to always define the symbols,
but this seems to be the root cause of most of the issues, so I'd suggest
we do both.

On a current linux-next kernel, I verified that this header is
responsible for all type mismatches as a result from the endianess
confusion.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Babu Moger <babu.moger@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nicolas Pitre <nico@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Fixes: ec0dc971dc51 ("locking/qrwlock: Use 'struct qrwlock' instead of 'struct __qrwlock'")
Link: http://lkml.kernel.org/r/20180202154104.1522809-1-arnd@arndb.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/asm-generic/qrwlock_types.h