diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2019-06-05 07:11:58 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-06-14 16:34:57 -0400 |
commit | cbdaeaf050b730ea02e9ab4ff844ce54d85dbe1d (patch) | |
tree | cd5d310741d4eaef730bf3029ba6c7f27d0c95ff /kernel/trace/ftrace.c | |
parent | becf33f694dc50656766e0fde8883437d5c8d4b4 (diff) |
tracing: avoid build warning with HAVE_NOP_MCOUNT
Selecting HAVE_NOP_MCOUNT enables -mnop-mcount (if gcc supports it)
and sets CC_USING_NOP_MCOUNT. Reuse __is_defined (which is suitable for
testing CC_USING_* defines) to avoid conditional compilation and fix
the following gcc 9 warning on s390:
kernel/trace/ftrace.c:2514:1: warning: ‘ftrace_code_disable’ defined
but not used [-Wunused-function]
Link: http://lkml.kernel.org/r/patch.git-1a82d13f33ac.your-ad-here.call-01559732716-ext-6629@work.hours
Fixes: 2f4df0017baed ("tracing: Add -mcount-nop option support")
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a12aff849c04..e77a6c92620f 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2935,14 +2935,13 @@ static int ftrace_update_code(struct module *mod, struct ftrace_page *new_pgs) | |||
2935 | p = &pg->records[i]; | 2935 | p = &pg->records[i]; |
2936 | p->flags = rec_flags; | 2936 | p->flags = rec_flags; |
2937 | 2937 | ||
2938 | #ifndef CC_USING_NOP_MCOUNT | ||
2939 | /* | 2938 | /* |
2940 | * Do the initial record conversion from mcount jump | 2939 | * Do the initial record conversion from mcount jump |
2941 | * to the NOP instructions. | 2940 | * to the NOP instructions. |
2942 | */ | 2941 | */ |
2943 | if (!ftrace_code_disable(mod, p)) | 2942 | if (!__is_defined(CC_USING_NOP_MCOUNT) && |
2943 | !ftrace_code_disable(mod, p)) | ||
2944 | break; | 2944 | break; |
2945 | #endif | ||
2946 | 2945 | ||
2947 | update_cnt++; | 2946 | update_cnt++; |
2948 | } | 2947 | } |