From patchwork Mon Mar 4 20:07:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 159594 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp4161879jad; Mon, 4 Mar 2019 12:08:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzAlG/utMKOKK+Stalb7SrQfW9eJ1bkHi03lZQJqObkyJGEqxDoE3m09CVS5/NcTatR2B7+ X-Received: by 2002:a63:61d8:: with SMTP id v207mr19982219pgb.308.1551730128757; Mon, 04 Mar 2019 12:08:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551730128; cv=none; d=google.com; s=arc-20160816; b=ENJH7mkwInuF3Nyfe/sV2xgTdnimj3MHISKmQkJgPEATqd2fxxQbnx4eW6altbg/0u GS1lTbtXQxyjxsohfZRylYVyCSih2PzVY+8CzBx9N+hjdiyFeFC9c1K7l6Z31XJI6ovK CloWYPxUV58ODXiKNn3znUnTJTif8/fjEfJfJOTnLzl8EPUEFTwVgyCcpkiYKRca9gK5 vD1XIlGTn3R/Jrsg+DagcGIAQ0/pBlg4FhLFX5yyjNnR7whwqqObSaWDQX8OzF10jNiQ E5eAb193htX4aSeY4sIBIJJ4TAYQgiNI+X3wnbeGYelR8JpmrL6pA+R2fUp9YHy0FeJX HHvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=yxoeJoMd3luXCvOcRJvE0szhlTgHvHCQT6Xz+m4xyBY=; b=Q6SrVmfKHd35ztaRdHEq6McNi7PinfZuFRiKJeqo/ZkP5nbBsxwsPKCtA3Sf6CIYk3 CIC/Xq/b2sA05n+1vgHHvAgc8wiuozZgCTt/UdACnmopN7+0emSW1OdAsTwlVvyil0/b HuIBs1Kz0CwybnkscFWCmJTGfqcPDT4BQazlfj7giwKLepp0GolJCmDDlNV6dqLwZD4N 9fBloBRV+lRd5HW2x5amZsEs28o1IUTGUJnLb0LwG9lgj0XfmAHTeFeS88vuFMObYLLR gKF/jEmlWTDR819RsgjjqjY1vXSQ2Da9BavKRdBnwh3RDGprIe03CwPKHkP0siYZfU6w 0riQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si6062962pgi.422.2019.03.04.12.08.48; Mon, 04 Mar 2019 12:08:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726381AbfCDUIq (ORCPT + 31 others); Mon, 4 Mar 2019 15:08:46 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:47195 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfCDUIq (ORCPT ); Mon, 4 Mar 2019 15:08:46 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MXY6b-1gTCfp3f3v-00Z2OQ; Mon, 04 Mar 2019 21:07:51 +0100 From: Arnd Bergmann To: Steven Rostedt , Ingo Molnar , Thomas Gleixner , Borislav Petkov , x86@kernel.org Cc: Arnd Bergmann , "H. Peter Anvin" , Masami Hiramatsu , linux-kernel@vger.kernel.org Subject: [PATCH] x86/ftrace: avoid an unused-function warning Date: Mon, 4 Mar 2019 21:07:39 +0100 Message-Id: <20190304200748.1418790-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:nklnExSuFdJPbitRhNjdFGGb6Ob0uFIGnEQxpkQ81TU7sFuMY4c +pmK2jZDKIOsZunuzfrHKye4pcZeSoDfRXGMsACoSPoS/alfheGIL0163fGGdGt3qKxc/O2 bGoNTt7yXEwFLsegyKQIQHVi+zn4PBVEERGz42VSp4rrSiMfF+RGiathm6q7Z7+admii1C0 z3I9Pf4XLklRtkuO1fJ0w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:dC39UAWXT3I=:1IaOMBzDetAo2faRVlDj95 CXW/jOx+4e3C0AudMD2yitWUf/LHiyuGKSXh/IbRgIYaeWUe9+x6jZQ0GhunJP3T3ju+Rmf0E 8LFx+QhOOHYXZCj6IbKfbj3YmhqPmMs+Bz4/ztqg01vj/m8Xal+Qo84qd+FJG9CQz3NeGxGHv WqOaKt+aVR75AUumdHH3GMa1mTndQpjLpEbLG8OHj/T0HBECdT0aalBYIr6DfUvGxUyuiULdZ h+QxnaMC3UJUGZ8hlbH7j1g6nrLMkfTm98iqLK4fgKnSLftI6Zw+024a0fVSPczPl/gfnA6VB swKe3oWl9iKeCBZSRbih8uFBGK3KpzuSyG77l1RT+gDkWFWhLJwfS1TQlMPGGFeruKNV3qPJs VAjekPP3BqkOXJ7PBhNIA9Leu/xs7dhp9Kq/hnyz4RPzlNzOVj66Ckun7NBAGjaLMFlwaJxtf Y8ccJJShfbV+I+9GCjEyFNpaW76UuDiiSFwssd9HxxUwhEqeMhKWg2JEqSFt2HsA1QFdMXm4+ rWflFLdxg6S75LZ4/C+cvduMBrOvvo5Lf3MOAfLnL4OIKD+DT+KPAXG9hGFemN7yl8IOg2M3y 1+zls+4SRm7FMz6hvvOZkTPecgYwlHs1Vo2CzcD10jG6qqaihXA+hgYv4r9gVpiQhOYHPIYuH 4QnrA9jFbFvbkYhPY+tI/zORZsKfl3uV1ID0q9j+eNWcLkPPIjsSTeXgVzf8GURVLO4nSAAiB urbzhUih2s4QpwoCBN2KSTV97DCIdnQOLS2rFg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Depending on the configuration, ftrace_jmp_replace() sometimes has no callers at all, since one of the users was removed: arch/x86/kernel/ftrace.c:669:23: error: 'ftrace_jmp_replace' defined but not used [-Werror=unused-function] Rather than trying to figure out the correct #ifdef check for this time, just mark it __maybe_unused and let the compiler drop it silently. Fixes: d2a68c4effd8 ("x86/ftrace: Do not call function graph from dynamic trampolines") Signed-off-by: Arnd Bergmann --- arch/x86/kernel/ftrace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.20.0 Reported-by: Arnd Bergmann Signed-off-by: Steven Rostedt (VMware) Acked-by: Arnd Bergmann diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 3e3789c8f8e1..905056240411 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@ -665,8 +665,7 @@ int __init ftrace_dyn_arch_init(void) return 0; } -#if defined(CONFIG_X86_64) || defined(CONFIG_FUNCTION_GRAPH_TRACER) -static unsigned char *ftrace_jmp_replace(unsigned long ip, unsigned long addr) +static __maybe_unused unsigned char *ftrace_jmp_replace(unsigned long ip, unsigned long addr) { static union ftrace_code_union calc; @@ -679,7 +678,6 @@ static unsigned char *ftrace_jmp_replace(unsigned long ip, unsigned long addr) */ return calc.code; } -#endif /* Currently only x86_64 supports dynamic trampolines */ #ifdef CONFIG_X86_64