summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorManuel Hernández Méndez <[email protected]>2025-07-21 18:07:12 +0200
committerAnup Patel <[email protected]>2025-08-26 16:37:47 +0530
commit3204d74486ecded839205be5a3bf0193aaca3547 (patch)
tree8b3318aa4ca58904c73fa901b24d9e7d713cf892 /lib
parent84044ee83c051fd2f39e34b29854993ecc95d7f0 (diff)
lib: sbi: pmu: Improve loop in pmu_ctr_find_hw
We do not need to iterate over all values in the loop, we can break the loop when we found a valid counter that is not started yet. Signed-off-by: Manuel Hernández Méndez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi/sbi_pmu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sbi/sbi_pmu.c b/lib/sbi/sbi_pmu.c
index 07a5c544..635cb0c7 100644
--- a/lib/sbi/sbi_pmu.c
+++ b/lib/sbi/sbi_pmu.c
@@ -780,6 +780,7 @@ static int pmu_ctr_find_hw(struct sbi_pmu_hart_state *phs,
continue;
/* We found a valid counter that is not started yet */
ctr_idx = cbase;
+ break;
}
}