[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210121000630.371883-3-yury.norov@gmail.com>
Date: Wed, 20 Jan 2021 16:06:26 -0800
From: Yury Norov <yury.norov@...il.com>
To: linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org,
linux-sh@...r.kernel.org, linux-arch@...r.kernel.org
Cc: Yury Norov <yury.norov@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>, Arnd Bergmann <arnd@...db.de>,
Dennis Zhou <dennis@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
David Sterba <dsterba@...e.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Stefano Brivio <sbrivio@...hat.com>,
"Ma, Jianpeng" <jianpeng.ma@...el.com>,
Wei Yang <richard.weiyang@...ux.alibaba.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Rasmus Villemoes <rasmus.villemoes@...vas.dk>
Subject: [PATCH 2/6] bitmap: move some macros from linux/bitmap.h to linux/bitops.h
In the following patches of the series they are used by
find_bit subsystem.
Signed-off-by: Yury Norov <yury.norov@...il.com>
---
include/linux/bitmap.h | 11 -----------
include/linux/bitops.h | 11 +++++++++++
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 70a932470b2d..5bacbc8785eb 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -219,17 +219,6 @@ extern unsigned int bitmap_ord_to_pos(const unsigned long *bitmap, unsigned int
extern int bitmap_print_to_pagebuf(bool list, char *buf,
const unsigned long *maskp, int nmaskbits);
-#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1)))
-#define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1)))
-
-/*
- * The static inlines below do not handle constant nbits==0 correctly,
- * so make such users (should any ever turn up) call the out-of-line
- * versions.
- */
-#define small_const_nbits(nbits) \
- (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0)
-
static inline void bitmap_zero(unsigned long *dst, unsigned int nbits)
{
unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index a5a48303b0f1..a0e138bbb8ce 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -7,6 +7,17 @@
#include <uapi/linux/kernel.h>
+#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1)))
+#define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1)))
+
+/*
+ * The static inlines below do not handle constant nbits==0 correctly,
+ * so make such users (should any ever turn up) call the out-of-line
+ * versions.
+ */
+#define small_const_nbits(nbits) \
+ (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0)
+
/* Set bits in the first 'n' bytes when loaded from memory */
#ifdef __LITTLE_ENDIAN
# define aligned_byte_mask(n) ((1UL << 8*(n))-1)
--
2.25.1
Powered by blists - more mailing lists