Yury Norov (NVIDIA)
unread,Oct 25, 2025, 12:33:32 PMOct 25Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Linus Walleij, Lee Jones, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, Marco Elver, Dmitry Vyukov, kasa...@googlegroups.com, Yury Norov (NVIDIA)
GENMASK(high, low) notation is confusing. Use BITS(low, high) and
FIRST_BITS() where appropriate.
Signed-off-by: Yury Norov (NVIDIA) <
yury....@gmail.com>
---
kernel/kcsan/encoding.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/kcsan/encoding.h b/kernel/kcsan/encoding.h
index 170a2bb22f53..3a4cb7b354e3 100644
--- a/kernel/kcsan/encoding.h
+++ b/kernel/kcsan/encoding.h
@@ -44,8 +44,8 @@
/* Bitmasks for the encoded watchpoint access information. */
#define WATCHPOINT_WRITE_MASK BIT(BITS_PER_LONG-1)
-#define WATCHPOINT_SIZE_MASK GENMASK(BITS_PER_LONG-2, WATCHPOINT_ADDR_BITS)
-#define WATCHPOINT_ADDR_MASK GENMASK(WATCHPOINT_ADDR_BITS-1, 0)
+#define WATCHPOINT_ADDR_MASK FIRST_BITS(WATCHPOINT_ADDR_BITS)
+#define WATCHPOINT_SIZE_MASK BITS(WATCHPOINT_ADDR_BITS, BITS_PER_LONG-2)
static_assert(WATCHPOINT_ADDR_MASK == (1UL << WATCHPOINT_ADDR_BITS) - 1);
static_assert((WATCHPOINT_WRITE_MASK ^ WATCHPOINT_SIZE_MASK ^ WATCHPOINT_ADDR_MASK) == ~0UL);
--
2.43.0