lkml.org 
[lkml]   [2009]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/3] trace: code style clean up
From: Steven Rostedt <srostedt@redhat.com>

Ingo Molar suggested using goto logic to keep the indentation
down and to be able to remove the nasty line breaks. This actually
makes the code a bit more readable.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
kernel/trace/trace.c | 29 +++++++++++++++--------------
1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index cfc0c3d..6f3cc5c 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -522,23 +522,24 @@ int register_tracer(struct tracer *type)
tracing_selftest_running = false;
mutex_unlock(&trace_types_lock);

- if (!ret && default_bootup_tracer) {
- if (!strncmp(default_bootup_tracer, type->name,
- BOOTUP_TRACER_SIZE)) {
- printk(KERN_INFO "Starting tracer '%s'\n",
- type->name);
- /* Do we want this tracer to start on bootup? */
- tracing_set_tracer(type->name);
- default_bootup_tracer = NULL;
- /* disable other selftests, since this will break it. */
- tracing_selftest_disabled = 1;
+ if (ret || !default_bootup_tracer)
+ goto out_unlock;
+
+ if (strncmp(default_bootup_tracer, type->name, BOOTUP_TRACER_SIZE))
+ goto out_unlock;
+
+ printk(KERN_INFO "Starting tracer '%s'\n", type->name);
+ /* Do we want this tracer to start on bootup? */
+ tracing_set_tracer(type->name);
+ default_bootup_tracer = NULL;
+ /* disable other selftests, since this will break it. */
+ tracing_selftest_disabled = 1;
#ifdef CONFIG_FTRACE_STARTUP_TEST
- printk(KERN_INFO "Disabling FTRACE selftests due"
- " to running tracer '%s'\n", type->name);
+ printk(KERN_INFO "Disabling FTRACE selftests due to running tracer '%s'\n",
+ type->name);
#endif
- }
- }

+ out_unlock:
lock_kernel();
return ret;
}
--
1.5.6.5
--


\
 
 \ /
  Last update: 2009-02-05 07:17    [W:0.297 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site