summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-07-09 17:10:46 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-17 10:15:04 -0700
commitf555f1231a69846d57099760f9c361982600ffa2 (patch)
treeac16a48bdf0c8b516d8153919670632501103ddb /kernel
parenta694d1b5916a486ce25fb5f2b39f2627f7afd5f3 (diff)
downloadblackbird-obmc-linux-f555f1231a69846d57099760f9c361982600ffa2.tar.gz
blackbird-obmc-linux-f555f1231a69846d57099760f9c361982600ffa2.zip
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')
-rw-r--r--kernel/trace/trace_functions.c15
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)
static int func_set_flag(u32 old_flags, u32 bit, int set)
{
- if (bit == TRACE_FUNC_OPT_STACK) {
+ switch (bit) {
+ case TRACE_FUNC_OPT_STACK:
/* do nothing if already set */
if (!!set == !!(func_flags.val & TRACE_FUNC_OPT_STACK))
- return 0;
+ break;
if (set) {
unregister_ftrace_function(&trace_ops);
@@ -230,12 +231,14 @@ static int func_set_flag(u32 old_flags, u32 bit, int set)
register_ftrace_function(&trace_ops);
}
- return 0;
- } else if (bit == TRACE_FUNC_OPT_PSTORE) {
- return 0;
+ break;
+ case TRACE_FUNC_OPT_PSTORE:
+ break;
+ default:
+ return -EINVAL;
}
- return -EINVAL;
+ return 0;
}
static struct tracer function_trace __read_mostly =
OpenPOWER on IntegriCloud