lkml.org 
[lkml]   [2018]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tools: Remove conflicting BITS_PER_LONG define
Date
  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
\
 
 \ /
  Last update: 2018-09-12 19:03    [W:0.089 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site