From: Kim Phillips <kim.phillips@arm.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>
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
Date: Fri, 16 Jun 2017 14:59:07 -0500 [thread overview]
Message-ID: <20170616145907.baba73eda242efe194e072d0@arm.com> (raw)
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 <acme@redhat.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Kim Phillips <kim.phillips@arm.com>
---
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
next reply other threads:[~2017-06-16 19:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-16 19:59 Kim Phillips [this message]
2017-06-19 17:51 ` [PATCH] [perf/core branch] perf coresight: Fix ARM builds caused by misplaced __printf Mathieu Poirier
2017-06-19 18:42 ` Arnaldo Carvalho de Melo
2017-06-19 19:26 ` Kim Phillips
2017-06-19 19:52 ` Arnaldo Carvalho de Melo
2017-06-19 20:29 ` Kim Phillips
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170616145907.baba73eda242efe194e072d0@arm.com \
--to=kim.phillips@arm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox