Commit daa6d912 authored by Christian Borntraeger's avatar Christian Borntraeger Committed by Greg Kroah-Hartman
Browse files

include/uapi/linux/swab.h: fix userspace breakage, use __BITS_PER_LONG for swap

commit 467d12f5 upstream.

QEMU has a funny new build error message when I use the upstream kernel
headers:

      CC      block/file-posix.o
    In file included from /home/cborntra/REPOS/qemu/include/qemu/timer.h:4,
                     from /home/cborntra/REPOS/qemu/include/qemu/timed-average.h:29,
                     from /home/cborntra/REPOS/qemu/include/block/accounting.h:28,
                     from /home/cborntra/REPOS/qemu/include/block/block_int.h:27,
                     from /home/cborntra/REPOS/qemu/block/file-posix.c:30:
    /usr/include/linux/swab.h: In function `__swab':
    /home/cborntra/REPOS/qemu/include/qemu/bitops.h:20:34: error: "sizeof" is not defined, evaluates to 0 [-Werror=undef]
       20 | #define BITS_PER_LONG           (sizeof (unsigned long) * BITS_PER_BYTE)
          |                                  ^~~~~~
    /home/cborntra/REPOS/qemu/include/qemu/bitops.h:2...
parent bbdeb8fd
linux-5.5.y Tags unavailable
No related merge requests found
Showing with 2 additions and 2 deletions
+2 -2
......@@ -135,9 +135,9 @@ static inline __attribute_const__ __u32 __fswahb32(__u32 val)
static __always_inline unsigned long __swab(const unsigned long y)
{
#if BITS_PER_LONG == 64
#if __BITS_PER_LONG == 64
return __swab64(y);
#else /* BITS_PER_LONG == 32 */
#else /* __BITS_PER_LONG == 32 */
return __swab32(y);
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment