[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAFZK-jp5aa8ihU5TZW-sbeMDwD0Rk0UcGm9NZB=42zic7zMxtg@mail.gmail.com>
Date:   Tue, 20 Mar 2018 13:44:39 +0100
From:   Wladislav Wiebe <wladislav.kw@...il.com>
To:     kstewart@...uxfoundation.org, gregkh@...uxfoundation.org,
        tglx@...utronix.de, pombredanne@...b.com
Cc:     linux-kernel@...r.kernel.org,
        Wladislav Wiebe <wladislav.kw@...il.com>
Subject: [PATCH] tools: fix another redefinition of BITS_PER_LONG
If BITS_PER_LONG gets already defined in
linux/tools/include/linux/bitops.h it shouldn't be
redefined in tools/include/asm-generic/bitsperlong.h.
This patch prevents such compilation error:
[..]/linux/tools/include/asm-generic/bitsperlong.h:8:0:
error: "BITS_PER_LONG" redefined [-Werror]
 #define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
In file included from [..]/linux/tools/include/linux/hashtable.h:13:0,
                 from elf.h:24,
                 from check.h:22,
                 from builtin-check.c:30:
[..]/linux/tools/include/linux/bitops.h:13:0:
note: this is the location of the previous definition
Signed-off-by: Wladislav Wiebe <wladislav.kw@...il.com>
---
 tools/include/asm-generic/bitsperlong.h | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/tools/include/asm-generic/bitsperlong.h
b/tools/include/asm-generic/bitsperlong.h
index 8f2283052333..c69a5fa3a096 100644
--- a/tools/include/asm-generic/bitsperlong.h
+++ b/tools/include/asm-generic/bitsperlong.h
@@ -4,11 +4,13 @@
 #include <uapi/asm-generic/bitsperlong.h>
+#ifndef BITS_PER_LONG
 #ifdef __SIZEOF_LONG__
 #define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
 #else
 #define BITS_PER_LONG __WORDSIZE
 #endif
+#endif
 #if BITS_PER_LONG != __BITS_PER_LONG
 #error Inconsistent word size. Check asm/bitsperlong.h
-- 
2.16.1
Powered by blists - more mailing lists
 
