forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/arch/xtensa/kernel/perf_event.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Xtensa Performance Monitor Module driver
34 * See Tensilica Debug User's Guide for PMU registers documentation.
45 *
56 * 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.
107 */
118
129 #include <linux/interrupt.h>
....@@ -365,9 +362,7 @@
365362 struct xtensa_pmu_events *ev = this_cpu_ptr(&xtensa_pmu_events);
366363 unsigned i;
367364
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) {
371366 uint32_t v = get_er(XTENSA_PMU_PMSTAT(i));
372367 struct perf_event *event = ev->event[i];
373368 struct hw_perf_event *hwc = &event->hw;