From: James Hogan Subject: [PATCH] metag: perf: fix build on Meta1 Date: Tue, 3 May 2016 09:40:37 +0100 Message-ID: <1462264837-26460-1-git-send-email-james.hogan@imgtec.com> Mime-Version: 1.0 Return-path: Sender: linux-metag-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: James Hogan Meta1 doesn't support PERF_ICORE or PERF_CHAN registers resulting in build errors due to missing definitions. Fix this with an ifdef matching the one in asm/metag_mem.h. The build errors (found by a randconfig): arch/metag/kernel/perf/perf_event.c: In function 'metag_pmu_enable_counter': arch/metag/kernel/perf/perf_event.c:639: error: 'PERF_ICORE0' undeclared (first use in this function) arch/metag/kernel/perf/perf_event.c:639: error: (Each undeclared identifier is reported only once arch/metag/kernel/perf/perf_event.c:639: error: for each function it appears in.) arch/metag/kernel/perf/perf_event.c:643: error: 'PERF_CHAN0' undeclared (first use in this function) Signed-off-by: James Hogan Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org --- arch/metag/kernel/perf/perf_event.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/metag/kernel/perf/perf_event.c b/arch/metag/kernel/perf/perf_event.c index 2478ec6d23c9..33a365f924be 100644 --- a/arch/metag/kernel/perf/perf_event.c +++ b/arch/metag/kernel/perf/perf_event.c @@ -618,6 +618,8 @@ static void metag_pmu_enable_counter(struct hw_perf_event *event, int idx) /* Check for a core internal or performance channel event. */ if (tmp) { + /* PERF_ICORE/PERF_CHAN only exist since Meta2 */ +#ifdef METAC_2_1 void *perf_addr; /* @@ -640,6 +642,7 @@ static void metag_pmu_enable_counter(struct hw_perf_event *event, int idx) if (perf_addr) metag_out32((config & 0x0f), perf_addr); +#endif /* * Now we use the high nibble as the performance event to -- 2.4.10