| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Xtensa Performance Monitor Module driver |
|---|
| 3 | 4 | * See Tensilica Debug User's Guide for PMU registers documentation. |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * Copyright (C) 2015 Cadence Design Systems Inc. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <linux/interrupt.h> |
|---|
| .. | .. |
|---|
| 365 | 362 | struct xtensa_pmu_events *ev = this_cpu_ptr(&xtensa_pmu_events); |
|---|
| 366 | 363 | unsigned i; |
|---|
| 367 | 364 | |
|---|
| 368 | | - for (i = find_first_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS); |
|---|
| 369 | | - i < XCHAL_NUM_PERF_COUNTERS; |
|---|
| 370 | | - i = find_next_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS, i + 1)) { |
|---|
| 365 | + for_each_set_bit(i, ev->used_mask, XCHAL_NUM_PERF_COUNTERS) { |
|---|
| 371 | 366 | uint32_t v = get_er(XTENSA_PMU_PMSTAT(i)); |
|---|
| 372 | 367 | struct perf_event *event = ev->event[i]; |
|---|
| 373 | 368 | struct hw_perf_event *hwc = &event->hw; |
|---|