public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: Remove conflicting BITS_PER_LONG define
@ 2018-09-12 17:02 Alexander Sverdlin
  2018-09-12 19:01 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Sverdlin @ 2018-09-12 17:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Sverdlin, Greg Kroah-Hartman, Thomas Gleixner,
	Arnaldo Carvalho de Melo, Peter Zijlstra

  CC       .../tools/objtool/builtin-check.o
  ...
In file included from .../tools/arch/x86/include/uapi/asm/bitsperlong.h:11:0,
                 from .../tools/include/asm-generic/bitops/__ffs.h:6,
                 from .../tools/include/asm-generic/bitops.h:16,
                 from .../tools/include/linux/bitops.h:35,
                 from .../tools/include/linux/hashtable.h:13,
                 from elf.h:24,
                 from check.h:22,
                 from builtin-check.c:30:
.../tools/include/asm-generic/bitsperlong.h:8:0: error: "BITS_PER_LONG" redefined [-Werror]
 #define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)

Include <asm/bitsperlong.h> instead as other headers do.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---

Seen during x86_64 build. Seems that most of the compilers do not define
__SIZEOF_LONG__, but my does.

 tools/include/linux/bitops.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h
index acc704b..4ae5232 100644
--- a/tools/include/linux/bitops.h
+++ b/tools/include/linux/bitops.h
@@ -3,16 +3,13 @@
 #define _TOOLS_LINUX_BITOPS_H_
 
 #include <asm/types.h>
+#include <asm/bitsperlong.h>
 #include <linux/compiler.h>
 
 #ifndef __WORDSIZE
 #define __WORDSIZE (__SIZEOF_LONG__ * 8)
 #endif
 
-#ifndef BITS_PER_LONG
-# define BITS_PER_LONG __WORDSIZE
-#endif
-
 #define BIT_MASK(nr)		(1UL << ((nr) % BITS_PER_LONG))
 #define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
 #define BITS_PER_BYTE		8
-- 
2.4.6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-09-24  8:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-12 17:02 [PATCH] tools: Remove conflicting BITS_PER_LONG define Alexander Sverdlin
2018-09-12 19:01 ` Arnaldo Carvalho de Melo
2018-09-12 19:21   ` Arnaldo Carvalho de Melo
2018-09-19 12:28     ` Alexander Sverdlin
2018-09-19 13:03       ` Arnaldo Carvalho de Melo
2018-09-19 15:25         ` Alexander Sverdlin
2018-09-24  8:33         ` Alexander Sverdlin
2018-09-19 12:16   ` Alexander Sverdlin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox