Re: [PATCH 4/5] ftrace: break out modify loop immediately ondetection of error

From: Ingo Molnar
Date: Fri Feb 20 2009 - 12:36:37 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -561,11 +561,15 @@ static void ftrace_replace_code(int enable)
> if ((system_state == SYSTEM_BOOTING) ||
> !core_kernel_text(rec->ip)) {
> ftrace_free_rec(rec);
> - } else
> + } else {
> ftrace_bug(failed, rec->ip);
> + goto out;
> + }
> }
> }
> }
> + out:
> + return;

wouldnt a simple 'break' suffice? Hm, nope,
do_for_each_ftrace_rec() is a double loop.

Then perhaps a 'return' would perhaps be cleaner in this case.
(even though it does make the flow a bit assymetric - the out
label and the empty return looks a bit ugly.)

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/