Skip to content
  • Arnd Bergmann's avatar
    locking/qrwlock: include asm/byteorder.h as needed · ca66e797
    Arnd Bergmann authored
    
    
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarPeter 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: e0d02285 ("locking/qrwlock: Use 'struct qrwlock' instead of 'struct __qrwlock'")
    Link: http://lkml.kernel.org/r/20180202154104.1522809-1-arnd@arndb.de
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    ca66e797