]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
x86/ftrace: Fix warning and considate ftrace_jmp_replace() and ftrace_call_replace()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 4 Mar 2019 21:35:22 +0000 (16:35 -0500)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 25 Mar 2019 15:49:09 +0000 (10:49 -0500)
commit7e59f16759df9623f0a8a98b78c49883564cc584
tree60a8f9a18a2499f4edf0031707700e7eb6d5fa2f
parentbe7e0b62cf244162b7ba10dafd1fd58028c9db14
x86/ftrace: Fix warning and considate ftrace_jmp_replace() and ftrace_call_replace()

BugLink: https://bugs.launchpad.net/bugs/1821607
commit 745cfeaac09ce359130a5451d90cb0bd4094c290 upstream.

Arnd reported the following compiler warning:

arch/x86/kernel/ftrace.c:669:23: error: 'ftrace_jmp_replace' defined but not used [-Werror=unused-function]

The ftrace_jmp_replace() function now only has a single user and should be
simply moved by that user. But looking at the code, it shows that
ftrace_jmp_replace() is similar to ftrace_call_replace() except that instead
of using the opcode of 0xe8 it uses 0xe9. It makes more sense to consolidate
that function into one implementation that both ftrace_jmp_replace() and
ftrace_call_replace() use by passing in the op code separate.

The structure in ftrace_code_union is also modified to replace the "e8"
field with the more appropriate name "op".

Cc: stable@vger.kernel.org
Reported-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: http://lkml.kernel.org/r/20190304200748.1418790-1-arnd@arndb.de
Fixes: d2a68c4effd8 ("x86/ftrace: Do not call function graph from dynamic trampolines")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/x86/kernel/ftrace.c