diff options
| author | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-07-09 20:10:46 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-17 13:15:04 -0400 |
| commit | f555f1231a69846d57099760f9c361982600ffa2 (patch) | |
| tree | ac16a48bdf0c8b516d8153919670632501103ddb /kernel/trace | |
| parent | a694d1b5916a486ce25fb5f2b39f2627f7afd5f3 (diff) | |
tracing/function: Convert func_set_flag() to a switch statement
Since the function accepts just one bit, we can use the switch
construction instead of if/else if/...
Just a cosmetic change, there should be no functional changes.
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/trace_functions.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index 13770abd7a12..a426f410c060 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c | |||
| @@ -217,10 +217,11 @@ static void tracing_stop_function_trace(void) | |||
| 217 | 217 | ||
| 218 | static int func_set_flag(u32 old_flags, u32 bit, int set) | 218 | static int func_set_flag(u32 old_flags, u32 bit, int set) |
| 219 | { | 219 | { |
| 220 | if (bit == TRACE_FUNC_OPT_STACK) { | 220 | switch (bit) { |
| 221 | case TRACE_FUNC_OPT_STACK: | ||
| 221 | /* do nothing if already set */ | 222 | /* do nothing if already set */ |
| 222 | if (!!set == !!(func_flags.val & TRACE_FUNC_OPT_STACK)) | 223 | if (!!set == !!(func_flags.val & TRACE_FUNC_OPT_STACK)) |
| 223 | return 0; | 224 | break; |
| 224 | 225 | ||
| 225 | if (set) { | 226 | if (set) { |
| 226 | unregister_ftrace_function(&trace_ops); | 227 | unregister_ftrace_function(&trace_ops); |
| @@ -230,12 +231,14 @@ static int func_set_flag(u32 old_flags, u32 bit, int set) | |||
| 230 | register_ftrace_function(&trace_ops); | 231 | register_ftrace_function(&trace_ops); |
| 231 | } | 232 | } |
| 232 | 233 | ||
| 233 | return 0; | 234 | break; |
| 234 | } else if (bit == TRACE_FUNC_OPT_PSTORE) { | 235 | case TRACE_FUNC_OPT_PSTORE: |
| 235 | return 0; | 236 | break; |
| 237 | default: | ||
| 238 | return -EINVAL; | ||
| 236 | } | 239 | } |
| 237 | 240 | ||
| 238 | return -EINVAL; | 241 | return 0; |
| 239 | } | 242 | } |
| 240 | 243 | ||
| 241 | static struct tracer function_trace __read_mostly = | 244 | static struct tracer function_trace __read_mostly = |
