public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu
Cc: alex@ghiti.fr, debug@rivosinc.com, thecharlesjenkins@gmail.com,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	mikey@neuling.org
Subject: [PATCH] riscv: ptrace: avoid BIT() in UAPI header
Date: Mon, 30 Mar 2026 02:42:48 +0000	[thread overview]
Message-ID: <20260330024248.449292-1-mikey@neuling.org> (raw)

BIT() is not available in UAPI headers — the installed linux/bits.h
(UAPI version) does not define it. Replace BIT() with open-coded
(1UL << x) which is the standard practice for UAPI headers, and drop
the linux/bits.h include that was added by commit 98545620b0 ("riscv:
ptrace: Fix BIT() compilation issues").

Fixes: 98545620b0 ("riscv: ptrace: Fix BIT() compilation issues")
Signed-off-by: Michael Neuling <mikey@neuling.org>
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---
 arch/riscv/include/uapi/asm/ptrace.h | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/riscv/include/uapi/asm/ptrace.h b/arch/riscv/include/uapi/asm/ptrace.h
index 5b53cea143..7cbd558b9b 100644
--- a/arch/riscv/include/uapi/asm/ptrace.h
+++ b/arch/riscv/include/uapi/asm/ptrace.h
@@ -8,7 +8,6 @@
 
 #ifndef __ASSEMBLER__
 
-#include <linux/bits.h>
 #include <linux/types.h>
 
 #define PTRACE_GETFDPIC		33
@@ -139,12 +138,12 @@ struct __sc_riscv_cfi_state {
 #define PTRACE_CFI_SS_LOCK_BIT	4
 #define PTRACE_CFI_SS_PTR_BIT	5
 
-#define PTRACE_CFI_LP_EN_STATE		BIT(PTRACE_CFI_LP_EN_BIT)
-#define PTRACE_CFI_LP_LOCK_STATE	BIT(PTRACE_CFI_LP_LOCK_BIT)
-#define PTRACE_CFI_ELP_STATE		BIT(PTRACE_CFI_ELP_BIT)
-#define PTRACE_CFI_SS_EN_STATE		BIT(PTRACE_CFI_SS_EN_BIT)
-#define PTRACE_CFI_SS_LOCK_STATE	BIT(PTRACE_CFI_SS_LOCK_BIT)
-#define PTRACE_CFI_SS_PTR_STATE		BIT(PTRACE_CFI_SS_PTR_BIT)
+#define PTRACE_CFI_LP_EN_STATE		(1UL << PTRACE_CFI_LP_EN_BIT)
+#define PTRACE_CFI_LP_LOCK_STATE	(1UL << PTRACE_CFI_LP_LOCK_BIT)
+#define PTRACE_CFI_ELP_STATE		(1UL << PTRACE_CFI_ELP_BIT)
+#define PTRACE_CFI_SS_EN_STATE		(1UL << PTRACE_CFI_SS_EN_BIT)
+#define PTRACE_CFI_SS_LOCK_STATE	(1UL << PTRACE_CFI_SS_LOCK_BIT)
+#define PTRACE_CFI_SS_PTR_STATE		(1UL << PTRACE_CFI_SS_PTR_BIT)
 
 #define PRACE_CFI_STATE_INVALID_MASK	~(PTRACE_CFI_LP_EN_STATE | \
 					  PTRACE_CFI_LP_LOCK_STATE | \
-- 
2.43.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2026-03-30  2:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  2:42 Michael Neuling [this message]
2026-03-30  3:05 ` [PATCH] riscv: ptrace: avoid BIT() in UAPI header Michael Neuling
2026-03-30  8:16 ` Andreas Schwab
2026-04-03  7:56   ` Paul Walmsley
2026-04-03  8:06 ` patchwork-bot+linux-riscv

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=20260330024248.449292-1-mikey@neuling.org \
    --to=mikey@neuling.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=debug@rivosinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=thecharlesjenkins@gmail.com \
    /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