lkml.org 
[lkml]   [2009]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/6] perf/core: Add a callback to perf events
    On Mon, Nov 02, 2009 at 02:49:32PM +1100, Paul Mackerras wrote:
    > Frederic Weisbecker writes:
    >
    > > @@ -4335,6 +4336,15 @@ perf_event_alloc(struct perf_event_attr *attr,
    > >
    > > event->state = PERF_EVENT_STATE_INACTIVE;
    > >
    > > + if (!callback) {
    > > + if (parent_event)
    > > + event->callback = parent_event->callback;
    > > + else
    > > + event->callback = NULL;
    > > + } else {
    > > + event->callback = callback;
    > > + }
    >
    > Wouldn't this be simpler and clearer as:
    >
    > if (!callback && parent_event)
    > callback = parent_event->callback;
    > event->callback = callback;
    >
    > ?
    >
    > Paul.


    Yep, I'm going to change that.
    Thanks.



    \
     
     \ /
      Last update: 2009-11-02 14:05    [W:0.021 / U:0.176 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site