Skip to content

Commit

Permalink
xtensa: simplify xtensa_pmu_irq_handler
Browse files Browse the repository at this point in the history
Use for_each_set_bit() instead of open-coding it to simplify the code.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Message-Id: <20200708062023.7986-1-vulab@iscas.ac.cn>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  • Loading branch information
Xu Wang authored and Max Filippov committed Jul 8, 2020
1 parent 0d5ab14 commit ee769eb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions arch/xtensa/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,7 @@ irqreturn_t xtensa_pmu_irq_handler(int irq, void *dev_id)
struct xtensa_pmu_events *ev = this_cpu_ptr(&xtensa_pmu_events);
unsigned i;

for (i = find_first_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS);
i < XCHAL_NUM_PERF_COUNTERS;
i = find_next_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS, i + 1)) {
for_each_set_bit(i, ev->used_mask, XCHAL_NUM_PERF_COUNTERS) {
uint32_t v = get_er(XTENSA_PMU_PMSTAT(i));
struct perf_event *event = ev->event[i];
struct hw_perf_event *hwc = &event->hw;
Expand Down

0 comments on commit ee769eb

Please sign in to comment.