Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "perf/arm_dmc620: Remove duplicate format attribute #defines"

This reverts commit a5f4ca68f348ac059efd6a3d7ad4040aed1c0818.

Pulling in the Arm-specific 'linux/perf/arm_pmu.h' header breaks the
allmodconfig build for x86:

> In file included from drivers/perf/arm_dmc620_pmu.c:26:
> include/linux/perf/arm_pmu.h:15:10: fatal error: asm/cputype.h: No such file or directory
> 15 | #include <asm/cputype.h>
> | ^~~~~~~~~~~~~~~

Just put things back like they were so that the driver can continue to
be compile-tested on a variety of architectures.

Link: https://lore.kernel.org/r/20231213100931.12d9d85e@canb.auug.org.au
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Will Deacon <will@kernel.org>

+21 -1
+21 -1
drivers/perf/arm_dmc620_pmu.c
··· 23 23 #include <linux/module.h> 24 24 #include <linux/mutex.h> 25 25 #include <linux/perf_event.h> 26 - #include <linux/perf/arm_pmu.h> 27 26 #include <linux/platform_device.h> 28 27 #include <linux/printk.h> 29 28 #include <linux/rculist.h> ··· 188 189 #define ATTR_CFG_FLD_clkdiv2_CFG config2 189 190 #define ATTR_CFG_FLD_clkdiv2_LO 9 190 191 #define ATTR_CFG_FLD_clkdiv2_HI 9 192 + 193 + #define __GEN_PMU_FORMAT_ATTR(cfg, lo, hi) \ 194 + (lo) == (hi) ? #cfg ":" #lo "\n" : #cfg ":" #lo "-" #hi 195 + 196 + #define _GEN_PMU_FORMAT_ATTR(cfg, lo, hi) \ 197 + __GEN_PMU_FORMAT_ATTR(cfg, lo, hi) 198 + 199 + #define GEN_PMU_FORMAT_ATTR(name) \ 200 + PMU_FORMAT_ATTR(name, \ 201 + _GEN_PMU_FORMAT_ATTR(ATTR_CFG_FLD_##name##_CFG, \ 202 + ATTR_CFG_FLD_##name##_LO, \ 203 + ATTR_CFG_FLD_##name##_HI)) 204 + 205 + #define _ATTR_CFG_GET_FLD(attr, cfg, lo, hi) \ 206 + ((((attr)->cfg) >> lo) & GENMASK_ULL(hi - lo, 0)) 207 + 208 + #define ATTR_CFG_GET_FLD(attr, name) \ 209 + _ATTR_CFG_GET_FLD(attr, \ 210 + ATTR_CFG_FLD_##name##_CFG, \ 211 + ATTR_CFG_FLD_##name##_LO, \ 212 + ATTR_CFG_FLD_##name##_HI) 191 213 192 214 GEN_PMU_FORMAT_ATTR(mask); 193 215 GEN_PMU_FORMAT_ATTR(match);