From patchwork Fri Jun 16 19:59:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 9793697 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0CD8060231 for ; Fri, 16 Jun 2017 19:59:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F403A2865F for ; Fri, 16 Jun 2017 19:59:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8BDB28668; Fri, 16 Jun 2017 19:59:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 83B372865F for ; Fri, 16 Jun 2017 19:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:Message-Id:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8eelW3r//fr24AR2o+KfTveeKbxhdHUjGQSaL9xfajc=; b=hMUu4cOCnWN1Sz KwuZiNo9xD+xSkTTGTKO45+H3T4ZFevE05n/ICBfEDdpNr3zEn1Tn/XRdhrMXr7mrw51in+UEmOSz 9lwdMPo4OR09/EI+0deEyMjAmRqyBHK16Y06BcWB1EgmOJe6Ytd4BnRI0pbldBypk/9pZTM5vFF5k ZXE9W5cpocSfZ4Z9DspfDug/yTYlvBdHh6N0xnDXBfSd8EAIqjbguxZ0NIz6oytE96P71JEUN8I8Y 0hX0vL3IQU9Kfstg2R/q16oY3PX+X9EVqq1bfsG1BGmawwNh4XBSsCA71mUAU9jeelN8PMhp9hLuw OKSugALpkmxeGfQjsaGw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dLxP3-0001dj-9I; Fri, 16 Jun 2017 19:59:33 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dLxP0-0001ck-Lv for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2017 19:59:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1F88E344; Fri, 16 Jun 2017 12:59:09 -0700 (PDT) Received: from dupont (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A5C913F581; Fri, 16 Jun 2017 12:59:08 -0700 (PDT) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170616_125930_730541_F4E1892B X-CRM114-Status: UNSURE ( 8.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Mathieu Poirier --- 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;