Skip to content

Commit a18ef64

Browse files
arndbtorvalds
authored andcommitted
tracing: make ftrace_likely_update() declaration visible
This function is only used when CONFIG_TRACE_BRANCH_PROFILING is set and DISABLE_BRANCH_PROFILING is not set, and the declaration is hidden behind this combination of tests. But that causes a warning when building with CONFIG_TRACING_BRANCHES, since that sets DISABLE_BRANCH_PROFILING for the tracing code, and the declaration is thus hidden: kernel/trace/trace_branch.c:205:6: error: no previous prototype for 'ftrace_likely_update' [-Werror=missing-prototypes] Move the declaration out of the #ifdef to avoid the warning. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f1fcbaa commit a18ef64

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/linux/compiler.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
* Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code
1313
* to disable branch tracing on a per file basis.
1414
*/
15-
#if defined(CONFIG_TRACE_BRANCH_PROFILING) \
16-
&& !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__)
1715
void ftrace_likely_update(struct ftrace_likely_data *f, int val,
1816
int expect, int is_constant);
19-
17+
#if defined(CONFIG_TRACE_BRANCH_PROFILING) \
18+
&& !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__)
2019
#define likely_notrace(x) __builtin_expect(!!(x), 1)
2120
#define unlikely_notrace(x) __builtin_expect(!!(x), 0)
2221

0 commit comments

Comments
 (0)