[PATCH 3/6] perf/core: Add a callback to perf events

From: Paul Mackerras
Date: Sun Nov 01 2009 - 23:47:37 EST


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.
--
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/