bitmap: replace bitmap_{from,to}_u32array
Subsystems (6)
[email protected]
maintainerPATCH 36/114 bitmap: replace bitmap_{from,to}_u32array
From: Yury Norov <[email protected]>
Subject: bitmap: replace bitmap_{from,to}_u32array
with bitmap_{from,to}_arr32 over the kernel. Additionally to it:
* __check_eq_bitmap() now takes single nbits argument.
* __check_eq_u32_array is not used in new test but may be used in future. So I don't remove it here, but annotate as __used.
Tested on arm64 and 32-bit BE mips.
[[email protected]: perf: arm_dsu_pmu: convert to bitmap_from_arr32]
[[email protected]: fix net/core/ethtool.c]
Signed-off-by Yury Norov <[email protected]>
Signed-off-by Arnd Bergmann <[email protected]>
Cc Ben Hutchings <[email protected]>
Cc David Decotigny <[email protected]>,
Cc David S. Miller <[email protected]>,
Cc Geert Uytterhoeven <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Rasmus Villemoes <[email protected]>
Cc Heiner Kallweit <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
arch/arm64/kernel/perf_event.c | 5 drivers/perf/arm_dsu_pmu.c | 6 include/linux/bitmap.h | 11 - lib/bitmap.c | 87 ------------- lib/test_bitmap.c | 206 ++++--------------------------- net/core/ethtool.c | 53 +++---- 6 files changed, 57 insertions(+), 311 deletions(-)
arch/arm64/kernel/perf_event.c renamed from arch/arm64/kernel/perf_event.c~bitmap-replace-bitmap_fromto_u32array +2 -3
@@ -925,9 +925,8 @@ static void __armv8pmu_probe_pmu(void *i pmceid[0 ] =read_sysreg (pmceid0_el0); pmceid[1 ] =read_sysreg (pmceid1_el0); -bitmap_from_u32array (cpu_pmu->pmceid_bitmap, -ARMV8_PMUV3_MAX_COMMON_EVENTS , pmceid, -ARRAY_SIZE (pmceid)); +bitmap_from_arr32 (cpu_pmu->pmceid_bitmap, + pmceid,ARMV8_PMUV3_MAX_COMMON_EVENTS ); }static int armv8pmu_probe_pmu (struct arm_pmu *cpu_pmu)
drivers/perf/arm_dsu_pmu.c renamed from drivers/perf/arm_dsu_pmu.c~bitmap-replace-bitmap_fromto_u32array +2 -4
@@ -658,10 +658,8 @@ static void dsu_pmu_probe_pmu(struct dsureturn ; cpmceid[0 ] =__dsu_pmu_read_pmceid (0 ); cpmceid[1 ] =__dsu_pmu_read_pmceid (1 ); -bitmap_from_u32array (dsu_pmu->cpmceid_bitmap, -DSU_PMU_MAX_COMMON_EVENTS , - cpmceid, -ARRAY_SIZE (cpmceid)); +bitmap_from_arr32 (dsu_pmu->cpmceid_bitmap, cpmceid, +DSU_PMU_MAX_COMMON_EVENTS ); }static void dsu_pmu_set_active_cpu (int cpu,struct dsu_pmu *dsu_pmu)
include/linux/bitmap.h renamed from include/linux/bitmap.h~bitmap-replace-bitmap_fromto_u32array +1 -10
@@ -64,8 +64,6 @@* bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region * bitmap_release_region(bitmap, pos, order) Free specified bit region * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region -* bitmap_from_u32array(dst, nbits, buf, nwords) *dst = *buf (nwords 32b words) -* bitmap_to_u32array(buf, nwords, src, nbits) *buf = *dst (nwords 32b words) * bitmap_from_arr32(dst, buf, nbits) Copy nbits from u32[] buf to dst * bitmap_to_arr32(buf, src, nbits) Copy nbits from buf to u32[] dst *
@@ -176,14 +174,7 @@ extern void bitmap_fold(unsigned long *dextern int bitmap_find_free_region (unsigned long *bitmap,unsigned int bits,int order);extern void bitmap_release_region (unsigned long *bitmap,unsigned int pos,int order);extern int bitmap_allocate_region (unsigned long *bitmap,unsigned int pos,int order); -extern unsigned int bitmap_from_u32array (unsigned long *bitmap, -unsigned int nbits, -const u32 *buf, -unsigned int nwords); -extern unsigned int bitmap_to_u32array (u32 *buf, -unsigned int nwords, -const unsigned long *bitmap, -unsigned int nbits); +#ifdef __BIG_ENDIANextern void bitmap_copy_le (unsigned long *dst,const unsigned long *src,unsigned int nbits);#else
lib/bitmap.c renamed from lib/bitmap.c~bitmap-replace-bitmap_fromto_u32array +0 -87
93 lines not on this page · raw message
lib/test_bitmap.c renamed from lib/test_bitmap.c~bitmap-replace-bitmap_fromto_u32array +31 -175
241 lines not on this page · raw message
net/core/ethtool.c renamed from net/core/ethtool.c~bitmap-replace-bitmap_fromto_u32array +21 -32
77 lines not on this page · raw message
_