[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210316015424.1999082-8-yury.norov@gmail.com>
Date: Mon, 15 Mar 2021 18:54:18 -0700
From: Yury Norov <yury.norov@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Yury Norov <yury.norov@...il.com>, linux-m68k@...ts.linux-m68k.org,
linux-arch@...r.kernel.org, linux-sh@...r.kernel.org,
Alexey Klimov <aklimov@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>, David Sterba <dsterba@...e.com>,
Dennis Zhou <dennis@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Jianpeng Ma <jianpeng.ma@...el.com>,
Joe Perches <joe@...ches.com>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Rich Felker <dalias@...c.org>,
Stefano Brivio <sbrivio@...hat.com>,
Wei Yang <richard.weiyang@...ux.alibaba.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>
Subject: [PATCH 07/13] tools: sync small_const_nbits() macro with the kernel
Move the macro from tools/include/asm-generic/bitsperlong.h
to tools/include/linux/bitmap.h
Signed-off-by: Yury Norov <yury.norov@...il.com>
---
tools/include/asm-generic/bitsperlong.h | 3 +++
tools/include/linux/bitmap.h | 3 ---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/include/asm-generic/bitsperlong.h b/tools/include/asm-generic/bitsperlong.h
index 8f2283052333..60b44bb4748b 100644
--- a/tools/include/asm-generic/bitsperlong.h
+++ b/tools/include/asm-generic/bitsperlong.h
@@ -18,4 +18,7 @@
#define BITS_PER_LONG_LONG 64
#endif
+#define SMALL_CONST(n) (__builtin_constant_p(n) && (unsigned long)(n) < BITS_PER_LONG)
+#define small_const_nbits(n) SMALL_CONST((n) - 1)
+
#endif /* __ASM_GENERIC_BITS_PER_LONG */
diff --git a/tools/include/linux/bitmap.h b/tools/include/linux/bitmap.h
index b6e8430c8bc9..433997b89565 100644
--- a/tools/include/linux/bitmap.h
+++ b/tools/include/linux/bitmap.h
@@ -19,9 +19,6 @@ int __bitmap_equal(const unsigned long *bitmap1,
const unsigned long *bitmap2, unsigned int bits);
void bitmap_clear(unsigned long *map, unsigned int start, int len);
-#define small_const_nbits(nbits) \
- (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG)
-
static inline void bitmap_zero(unsigned long *dst, unsigned int nbits)
{
if (small_const_nbits(nbits))
--
2.25.1
Powered by blists - more mailing lists