From: Dapeng Mi Date: Tue, 20 Aug 2024 07:38:50 +0000 (+0000) Subject: perf/x86: Refine hybrid_pmu_type defination X-Git-Tag: v6.13-rc1~179^2~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=79390db9eb32b2ba63c6be9fb83f12617259011d;p=thirdparty%2Fkernel%2Flinux.git perf/x86: Refine hybrid_pmu_type defination Use macros instead of magic number to define hybrid_pmu_type and remove X86_HYBRID_NUM_PMUS since it's never used. Signed-off-by: Dapeng Mi Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Tested-by: Yongwei Ma Link: https://lkml.kernel.org/r/20240820073853.1974746-2-dapeng1.mi@linux.intel.com --- diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h index ac1182141bf67..fdd7d0369d42c 100644 --- a/arch/x86/events/perf_event.h +++ b/arch/x86/events/perf_event.h @@ -674,19 +674,17 @@ enum hybrid_cpu_type { HYBRID_INTEL_CORE = 0x40, }; +#define X86_HYBRID_PMU_ATOM_IDX 0 +#define X86_HYBRID_PMU_CORE_IDX 1 + enum hybrid_pmu_type { not_hybrid, - hybrid_small = BIT(0), - hybrid_big = BIT(1), + hybrid_small = BIT(X86_HYBRID_PMU_ATOM_IDX), + hybrid_big = BIT(X86_HYBRID_PMU_CORE_IDX), hybrid_big_small = hybrid_big | hybrid_small, /* only used for matching */ }; -#define X86_HYBRID_PMU_ATOM_IDX 0 -#define X86_HYBRID_PMU_CORE_IDX 1 - -#define X86_HYBRID_NUM_PMUS 2 - struct x86_hybrid_pmu { struct pmu pmu; const char *name;