Compiling error if CONFIG_CPU_SUP_INTEL is disabled

From: Alec Ari
Date: Wed Mar 13 2019 - 23:40:24 EST


If CONFIG_CPU_SUP_INTEL is disabled with either the 5.0.2 or 4.20.16
kernel, it errors out right away:

In file included from arch/x86/events/amd/core.c:8:
arch/x86/events/amd/../perf_event.h:1035:45: warning: âstruct
cpu_hw_eventâ declared inside parameter list will not be visible
outside of this definition or declaration
static inline int intel_cpuc_prepare(struct cpu_hw_event *cpuc, int cpu)
^~~~~~~~~~~~
arch/x86/events/amd/../perf_event.h:1040:45: warning: âstruct
cpu_hw_eventâ declared inside parameter list will not be visible
outside of this definition or declaration
static inline void intel_cpuc_finish(struct cpu_hw_event *cpuc)
^~~~~~~~~~~~
CC arch/x86/events/amd/uncore.o
CC arch/x86/events/amd/ibs.o
AR kernel/bpf/built-in.a
CC kernel/cgroup/cgroup.o
In file included from arch/x86/events/amd/ibs.c:19:
arch/x86/events/amd/../perf_event.h:1035:45: warning: âstruct
cpu_hw_eventâ declared inside parameter list will not be visible
outside of this definition or declaration
static inline int intel_cpuc_prepare(struct cpu_hw_event *cpuc, int cpu)
^~~~~~~~~~~~
arch/x86/events/amd/../perf_event.h:1040:45: warning: âstruct
cpu_hw_eventâ declared inside parameter list will not be visible
outside of this definition or declaration
static inline void intel_cpuc_finish(struct cpu_hw_event *cpuc)
^~~~~~~~~~~~
AR arch/x86/events/amd/built-in.a
CC arch/x86/events/core.o
In file included from arch/x86/events/core.c:44:
arch/x86/events/perf_event.h:1035:45: warning: âstruct cpu_hw_eventâ
declared inside parameter list will not be visible outside of this
definition or declaration
static inline int intel_cpuc_prepare(struct cpu_hw_event *cpuc, int cpu)
^~~~~~~~~~~~
arch/x86/events/perf_event.h:1040:45: warning: âstruct cpu_hw_eventâ
declared inside parameter list will not be visible outside of this
definition or declaration
static inline void intel_cpuc_finish(struct cpu_hw_event *cpuc)
^~~~~~~~~~~~
arch/x86/events/core.c: In function âfree_fake_cpucâ:
arch/x86/events/core.c:1998:20: error: passing argument 1 of
âintel_cpuc_finishâ from incompatible pointer type
[-Werror=incompatible-pointer-types]
intel_cpuc_finish(cpuc);
^~~~
In file included from arch/x86/events/core.c:44:
arch/x86/events/perf_event.h:1040:59: note: expected âstruct
cpu_hw_event *â but argument is of type âstruct cpu_hw_events *â
static inline void intel_cpuc_finish(struct cpu_hw_event *cpuc)
~~~~~~~~~~~~~~~~~~~~~^~~~
arch/x86/events/core.c: In function âallocate_fake_cpucâ:
arch/x86/events/core.c:2012:25: error: passing argument 1 of
âintel_cpuc_prepareâ from incompatible pointer type
[-Werror=incompatible-pointer-types]
if (intel_cpuc_prepare(cpuc, cpu))
^~~~
In file included from arch/x86/events/core.c:44:
arch/x86/events/perf_event.h:1035:59: note: expected âstruct
cpu_hw_event *â but argument is of type âstruct cpu_hw_events *â
static inline int intel_cpuc_prepare(struct cpu_hw_event *cpuc, int cpu)
~~~~~~~~~~~~~~~~~~~~~^~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:291: arch/x86/events/core.o] Error 1
make[1]: *** [scripts/Makefile.build:516: arch/x86/events] Error 2
make: *** [Makefile:1058: arch/x86] Error 2