2018-02-01 17:26:12

by Yury Norov

[permalink] [raw]
Subject: [Next] [PATCH 0/2] Fixes for bitmap_{from,to}_arr32()

First patch replaces bitmap_from_u32array() from
drivers/perf/arm_dsu_pmu.c. The change that adds dependency on
bitmap_from_u32array() appeared in linux-next recently, so patch
may be applied only now.

Second patch renames bitmap_copy_safe with bitmap_copy_clear_tail
as suggested in review:
https://lkml.org/lkml/2018/1/8/1052

Andrew, Stephen, please apply it in linux-next branch, or meld in
corresponding commits if you prefer:
87e93201a5264c3 (bitmap: replace bitmap_{from,to}_u32array)
c27460ea428a257 (bitmap: new bitmap_copy_safe and bitmap_{from,to}_arr32)
(branch next-20180201)

Arnd Bergmann (1):
perf: arm_dsu_pmu: convert to bitmap_from_arr32

Yury Norov (1):
rename bitmap_copy_safe to bitmap_copy_clear_tail

drivers/perf/arm_dsu_pmu.c | 6 ++----
include/linux/bitmap.h | 10 +++++-----
2 files changed, 7 insertions(+), 9 deletions(-)

--
2.11.0



2018-02-01 17:27:13

by Yury Norov

[permalink] [raw]
Subject: [PATCH 2/2] rename bitmap_copy_safe to bitmap_copy_clear_tail

Rename is proposed in review:
https://lkml.org/lkml/2018/1/8/1052

Suggested-by: Rasmus Villemoes <[email protected]>
Signed-off-by: Yury Norov <[email protected]>
---
include/linux/bitmap.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 49aea0b37994..5f11fbdc27f8 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -233,7 +233,7 @@ static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
/*
* Copy bitmap and clear tail bits in last word.
*/
-static inline void bitmap_copy_safe(unsigned long *dst,
+static inline void bitmap_copy_clear_tail(unsigned long *dst,
const unsigned long *src, unsigned int nbits)
{
bitmap_copy(dst, src, nbits);
@@ -251,11 +251,11 @@ extern void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf,
extern void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap,
unsigned int nbits);
#else
-#define bitmap_from_arr32(bitmap, buf, nbits) \
- bitmap_copy_safe((unsigned long *) (bitmap), \
+#define bitmap_from_arr32(bitmap, buf, nbits) \
+ bitmap_copy_clear_tail((unsigned long *) (bitmap), \
(const unsigned long *) (buf), (nbits))
-#define bitmap_to_arr32(buf, bitmap, nbits) \
- bitmap_copy_safe((unsigned long *) (buf), \
+#define bitmap_to_arr32(buf, bitmap, nbits) \
+ bitmap_copy_clear_tail((unsigned long *) (buf), \
(const unsigned long *) (bitmap), (nbits))
#endif

--
2.11.0


2018-02-01 17:27:46

by Yury Norov

[permalink] [raw]
Subject: [PATCH 1/2] perf: arm_dsu_pmu: convert to bitmap_from_arr32

From: Arnd Bergmann <[email protected]>

The bitmap_from_u32array() interface got replaced in a global
change, but the arm_dsu_pmu driver adds another instance,
resulting in a build failure:

drivers/perf/arm_dsu_pmu.c: In function 'dsu_pmu_probe_pmu':
drivers/perf/arm_dsu_pmu.c:661:2: error: implicit declaration of function 'bitmap_from_u32array'; did you mean 'bitmap_from_arr32'? [-Werror=implicit-function-declaration]

This changes the new instance accordingly.

Fixes: mmotm ("bitmap: replace bitmap_{from,to}_u32array")
Fixes: 7520fa99246d ("perf: ARM DynamIQ Shared Unit PMU support")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Yury Norov <[email protected]>
---
drivers/perf/arm_dsu_pmu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c
index 93c50e377507..38f2cc2a6c74 100644
--- a/drivers/perf/arm_dsu_pmu.c
+++ b/drivers/perf/arm_dsu_pmu.c
@@ -658,10 +658,8 @@ static void dsu_pmu_probe_pmu(struct dsu_pmu *dsu_pmu)
return;
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)
--
2.11.0