[RFC PATCH V3 20/43] rv64ilp32_abi: drivers/perf: Adapt xlen_t of sbiret

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

Because rv64ilp32_abi change the sbiret struct,

from:
struct sbiret {
long error;
long value;
};

to:
struct sbiret {
xlen_t error;
xlen_t value;
};

So, use a cast long to prevent compile warning.

Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
---
drivers/perf/riscv_pmu_sbi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
index 698de8ddf895..e2c4d1bcbc7c 100644
--- a/drivers/perf/riscv_pmu_sbi.c
+++ b/drivers/perf/riscv_pmu_sbi.c
@@ -638,7 +638,7 @@ static int pmu_sbi_snapshot_setup(struct riscv_pmu *pmu, int cpu)
/* Free up the snapshot area memory and fall back to SBI PMU calls without snapshot */
if (ret.error) {
if (ret.error != SBI_ERR_NOT_SUPPORTED)
- pr_warn("pmu snapshot setup failed with error %ld\n", ret.error);
+ pr_warn("pmu snapshot setup failed with error %ld\n", (long)ret.error);
return sbi_err_map_linux_errno(ret.error);
}

@@ -679,7 +679,7 @@ static u64 pmu_sbi_ctr_read(struct perf_event *event)
val |= ((u64)ret.value << 32);
else
WARN_ONCE(1, "Unable to read upper 32 bits of firmware counter error: %ld\n",
- ret.error);
+ (long)ret.error);
}
} else {
val = riscv_pmu_ctr_read_csr(info.csr);
--
2.40.1