[PATCH v2] riscv: hwprobe: use _BITULL() rather than BIT() in MIPS vendor uapi header
From: Zongmin Zhou
Date: Fri Sep 18 2026 - 03:50:13 EST
From: Zongmin Zhou <zhouzongmin@xxxxxxxxxx>
BIT() is a kernel-internal macro that is not available to userspace, but
the MIPS vendor extension uapi header uses it without defining or
including it. Any userspace program that includes this header and uses
RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL fails to build.
Use _BITULL(0) from linux/const.h instead, which keeps the value at 1,
so there is no ABI change.
Fixes: bb4b0f8a1bcb ("riscv: hwprobe: Add MIPS vendor extension probing")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Zongmin Zhou <zhouzongmin@xxxxxxxxxx>
Reviewed-by: Jesse Taube <jtaubepe@xxxxxxxxxx>
---
Changes in v2:
- Add Cc: stable@xxxxxxxxxxxxxxx as suggested by Jesse Taube.
- Collect Reviewed-by from Jesse Taube (no code changes).
arch/riscv/include/uapi/asm/vendor/mips.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/include/uapi/asm/vendor/mips.h b/arch/riscv/include/uapi/asm/vendor/mips.h
index e65ab268b265..a31c23afe74f 100644
--- a/arch/riscv/include/uapi/asm/vendor/mips.h
+++ b/arch/riscv/include/uapi/asm/vendor/mips.h
@@ -1,3 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#define RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL BIT(0)
+#include <linux/const.h>
+
+#define RISCV_HWPROBE_VENDOR_EXT_XMIPSEXECTL _BITULL(0)
--
2.34.1
No virus found
Checked by Hillstone Network AntiVirus