[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251025163305.306787-9-yury.norov@gmail.com>
Date: Sat, 25 Oct 2025 12:32:58 -0400
From: "Yury Norov (NVIDIA)" <yury.norov@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Lee Jones <lee@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Marco Elver <elver@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
kasan-dev@...glegroups.com
Cc: "Yury Norov (NVIDIA)" <yury.norov@...il.com>
Subject: [PATCH 16/21] kcsan: don't use GENMASK()
GENMASK(high, low) notation is confusing. Use BITS(low, high) and
FIRST_BITS() where appropriate.
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@...il.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
Powered by blists - more mailing lists