[RFC PATCH V3 19/43] rv64ilp32_abi: irqchip: irq-riscv-intc: Use xlen_t instead of ulong

guoren
2025-03-25T12:21:17Z

The RV64ILP32 ABI is based on CONFIG_64BIT, so use xlen/xlen_t
instead of BITS_PER_LONG/ulong.

Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
---
drivers/irqchip/irq-riscv-intc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c
index f653c13de62b..4fc7d5704acf 100644
--- a/drivers/irqchip/irq-riscv-intc.c
+++ b/drivers/irqchip/irq-riscv-intc.c
@@ -20,18 +20,19 @@
#include <linux/soc/andes/irq.h>

#include <asm/hwcap.h>
+#include <asm/ptrace.h>

static struct irq_domain *intc_domain;
-static unsigned int riscv_intc_nr_irqs __ro_after_init = BITS_PER_LONG;
-static unsigned int riscv_intc_custom_base __ro_after_init = BITS_PER_LONG;
+static unsigned int riscv_intc_nr_irqs __ro_after_init = __riscv_xlen;
+static unsigned int riscv_intc_custom_base __ro_after_init = __riscv_xlen;
static unsigned int riscv_intc_custom_nr_irqs __ro_after_init;

static void riscv_intc_irq(struct pt_regs *regs)
{
- unsigned long cause = regs->cause & ~CAUSE_IRQ_FLAG;
+ xlen_t cause = regs->cause & ~CAUSE_IRQ_FLAG;

if (generic_handle_domain_irq(intc_domain, cause))
- pr_warn_ratelimited("Failed to handle interrupt (cause: %ld)\n", cause);
+ pr_warn_ratelimited("Failed to handle interrupt (cause: " REG_FMT ")\n", cause);
}

static void riscv_intc_aia_irq(struct pt_regs *regs)
--
2.40.1