mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
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>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user