lkml.org 
[lkml]   [2009]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 4/5] ftrace: break out modify loop immediately on detection of error

    On Fri, 20 Feb 2009, Ingo Molnar wrote:

    >
    > * Steven Rostedt <rostedt@goodmis.org> 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.)

    I guess a return would work too. I did the out jump to annotate the escape
    a bit more. Both are ugly IMHO. I'll switch it to return in the else
    statement.

    -- Steve



    \
     
     \ /
      Last update: 2009-02-20 18:57    [W:0.024 / U:29.128 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site