diff options
author | Atish Patra <atishp@rivosinc.com> | 2024-11-19 11:34:36 -0800 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2024-12-02 09:52:50 +0530 |
commit | cf196d80aa0850cb9658a8e670fcbb72ed26dc71 (patch) | |
tree | ce40afbd5f872cacd8abd3f9a315316f9bd2abe1 | |
parent | d8a483fc7fd05f7c72a1690e0db326bd4bcd5514 (diff) | |
download | opensbi-cf196d80aa0850cb9658a8e670fcbb72ed26dc71.zip opensbi-cf196d80aa0850cb9658a8e670fcbb72ed26dc71.tar.gz opensbi-cf196d80aa0850cb9658a8e670fcbb72ed26dc71.tar.bz2 |
lib: sbi_pmu: Remove redundant check for fw events
The pmu_validate_event already has the same check for fw events.
The validate function is called prior to the current function
to find a counter for firmware. That's why, the redudant
check can be removed from the find counter function.
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
-rw-r--r-- | lib/sbi/sbi_pmu.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/sbi/sbi_pmu.c b/lib/sbi/sbi_pmu.c index 972b85f..4fcacbe 100644 --- a/lib/sbi/sbi_pmu.c +++ b/lib/sbi/sbi_pmu.c @@ -795,11 +795,6 @@ static int pmu_ctr_find_fw(struct sbi_pmu_hart_state *phs, { int i, cidx; - if ((event_code >= SBI_PMU_FW_MAX && - event_code <= SBI_PMU_FW_RESERVED_MAX) || - event_code > SBI_PMU_FW_PLATFORM) - return SBI_EINVAL; - for_each_set_bit(i, &cmask, BITS_PER_LONG) { cidx = i + cbase; if (cidx < num_hw_ctrs || total_ctrs <= cidx) |