History

bitops: rename for_each_set_bit_cont() in favor of analogous list.h function

This renames for_each_set_bit_cont() to for_each_set_bit_from() because it is analogous to list_for_each_entry_from() in list.h rather than list_for_each_entry_continue(). This doesn't remove for_each_set_bit_cont() for now.

Akinobu Mita committed 14 years ago

Commit 307b1cd1 parent 2df5e123 files · +7 −4Browse files

Unified · Split

3 files
  1. arch/x86/kernel/cpu/perf_event.c +2 −2
  2. include/linux/bitops.h +4 −1
  3. tools/perf/util/include/linux/bitops.h +1 −1
arch/x86/kernel/cpu/perf_event.c+2−2
@@ -643,14 +643,14 @@ static bool __perf_sched_find_counter(struct perf_sched *sched) · 642 unmodified lines
643643 /* Prefer fixed purpose counters */
644644 if (x86_pmu.num_counters_fixed) {
645645 idx = X86_PMC_IDX_FIXED;
646− for_each_set_bit_cont(idx, c->idxmsk, X86_PMC_IDX_MAX) {
646+ for_each_set_bit_from(idx, c->idxmsk, X86_PMC_IDX_MAX) {
647647 if (!__test_and_set_bit(idx, sched->state.used))
648648 goto done;
649649 }
650650 }
651651 /* Grab the first unused counter starting with idx */
652652 idx = sched->state.counter;
653− for_each_set_bit_cont(idx, c->idxmsk, X86_PMC_IDX_FIXED) {
653+ for_each_set_bit_from(idx, c->idxmsk, X86_PMC_IDX_FIXED) {
654654 if (!__test_and_set_bit(idx, sched->state.used))
655655 goto done;
656656 }
include/linux/bitops.h+4−1
@@ -27,11 +27,14 @@ extern unsigned long __sw_hweight64(__u64 w); · 26 unmodified lines
2727 (bit) = find_next_bit((addr), (size), (bit) + 1))
2828
2929 /* same as for_each_set_bit() but use bit as value to start with */
30−#define for_each_set_bit_cont(bit, addr, size) \
30+#define for_each_set_bit_from(bit, addr, size) \
3131 for ((bit) = find_next_bit((addr), (size), (bit)); \
3232 (bit) < (size); \
3333 (bit) = find_next_bit((addr), (size), (bit) + 1))
3434
35+#define for_each_set_bit_cont(bit, addr, size) \
36+ for_each_set_bit_from(bit, addr, size)
37+
3538 static __inline__ int get_bitmask_order(unsigned int count)
3639 {
3740 int order;
tools/perf/util/include/linux/bitops.h+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 (bit) = find_next_bit((addr), (size), (bit) + 1))
1616
1717 /* same as for_each_set_bit() but use bit as value to start with */
18−#define for_each_set_bit_cont(bit, addr, size) \
18+#define for_each_set_bit_from(bit, addr, size) \
1919 for ((bit) = find_next_bit((addr), (size), (bit)); \
2020 (bit) < (size); \
2121 (bit) = find_next_bit((addr), (size), (bit) + 1))