History

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

Vasily Gorbik committed 7 years ago

Commit cbdaeaf1 parent becf33f1 file · +2 −3Browse files

Unified · Split

kernel/trace/ftrace.c+2−3
@@ -2935,14 +2935,13 @@ static int ftrace_update_code(struct module *mod, struct ftrace_page *new_pgs) · 2934 unmodified lines
29352935 p = &pg->records[i];
29362936 p->flags = rec_flags;
29372937
2938−#ifndef CC_USING_NOP_MCOUNT
29392938 /*
29402939 * Do the initial record conversion from mcount jump
29412940 * to the NOP instructions.
29422941 */
2943− if (!ftrace_code_disable(mod, p))
2942+ if (!__is_defined(CC_USING_NOP_MCOUNT) &&
2943+ !ftrace_code_disable(mod, p))
29442944 break;
2945−#endif
29462945
29472946 update_cnt++;
29482947 }