From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750987AbdFPT7K (ORCPT ); Fri, 16 Jun 2017 15:59:10 -0400 Received: from foss.arm.com ([217.140.101.70]:33962 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750780AbdFPT7J (ORCPT ); Fri, 16 Jun 2017 15:59:09 -0400 Date: Fri, 16 Jun 2017 14:59:07 -0500 From: Kim Phillips To: Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] [perf/core branch] perf coresight: Fix ARM builds caused by misplaced __printf Message-Id: <20170616145907.baba73eda242efe194e072d0@arm.com> Organization: ARM X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Trailing __printf attributes work for function declarations, but not definitions. This patch fixes arm32/64 builds by placing __printf before the declarator. Otherwise this happens: arch/arm64/util/../../arm/util/cs-etm.c:586:1: error: attributes should be specified before the declarator in a function definition static int cs_device__print_file(const char *name, const char *fmt, ...) __printf(2, 3) ^~~~~~ arch/arm64/util/../../arm/util/cs-etm.c: In function ‘cs_etm_set_drv_config’: arch/arm64/util/../../arm/util/cs-etm.c:610:8: error: implicit declaration of function ‘cs_device__print_file’ [-Werror=implicit-function-declaration] ret = cs_device__print_file(enable_sink, "%d", 1); ^~~~~~~~~~~~~~~~~~~~~ arch/arm64/util/../../arm/util/cs-etm.c:610:2: error: nested extern declaration of ‘cs_device__print_file’ [-Werror=nested-externs] ret = cs_device__print_file(enable_sink, "%d", 1); ^~~ At top level: arch/arm64/util/../../arm/util/cs-etm.c:566:14: error: ‘cs_device__open_file’ defined but not used [-Werror=unused-function] static FILE *cs_device__open_file(const char *name) ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Fixes: 2ee261d962ac "tools: Adopt __printf from kernel sources" Cc: Arnaldo Carvalho de Melo Cc: Mathieu Poirier Signed-off-by: Kim Phillips --- Applies to acme's perf/core branch tools/perf/arch/arm/util/cs-etm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 90a6f42ba904..7ce3d1a25133 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -583,7 +583,7 @@ static FILE *cs_device__open_file(const char *name) } -static int cs_device__print_file(const char *name, const char *fmt, ...) __printf(2, 3) +static int __printf(2, 3) cs_device__print_file(const char *name, const char *fmt, ...) { va_list args; FILE *file; -- 2.11.0