From: Yury Norov <yury.norov@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Yury Norov <yury.norov@gmail.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Arnd Bergmann <arnd@arndb.de>,
Anshuman Khandual <anshuman.khandual@arm.com>
Subject: [PATCH] uapi: enforce non-asm rule for 128-bit bitmasks macros
Date: Sat, 3 Aug 2024 06:37:52 -0700 [thread overview]
Message-ID: <20240803133753.1598137-1-yury.norov@gmail.com> (raw)
The macros wouldn't work in all assembler flavors for reasons described
in the comments on top of declarations. Enforce it for more by adding
!__ASSEMBLY__ guard.
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
include/linux/bits.h | 2 ++
include/uapi/linux/const.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/include/linux/bits.h b/include/linux/bits.h
index bf99feb5570e..60044b608817 100644
--- a/include/linux/bits.h
+++ b/include/linux/bits.h
@@ -36,6 +36,7 @@
#define GENMASK_ULL(h, l) \
(GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))
+#if !defined(__ASSEMBLY__)
/*
* Missing asm support
*
@@ -48,5 +49,6 @@
*/
#define GENMASK_U128(h, l) \
(GENMASK_INPUT_CHECK(h, l) + __GENMASK_U128(h, l))
+#endif
#endif /* __LINUX_BITS_H */
diff --git a/include/uapi/linux/const.h b/include/uapi/linux/const.h
index 5be12e8f8f9c..e16be0d37746 100644
--- a/include/uapi/linux/const.h
+++ b/include/uapi/linux/const.h
@@ -28,6 +28,7 @@
#define _BITUL(x) (_UL(1) << (x))
#define _BITULL(x) (_ULL(1) << (x))
+#if !defined(__ASSEMBLY__)
/*
* Missing asm support
*
@@ -42,6 +43,7 @@
* GENMASK_U128() which would then start supporting asm code.
*/
#define _BIT128(x) ((unsigned __int128)(1) << (x))
+#endif
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
--
2.43.0
next reply other threads:[~2024-08-03 13:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-03 13:37 Yury Norov [this message]
2024-08-04 23:28 ` Anshuman Khandual
2024-08-05 16:21 ` Yury Norov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240803133753.1598137-1-yury.norov@gmail.com \
--to=yury.norov@gmail.com \
--cc=anshuman.khandual@arm.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®