Re: [patch 2/9] LTTng instrumentation - irq

From: Ingo Molnar
Date: Tue Mar 24 2009 - 15:16:27 EST



* Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx> wrote:

> +static irqreturn_t __handle_irq_next_handler(unsigned int irq,
> + struct irqaction **action, irqreturn_t *retval, unsigned int *status)
> +{
> + irqreturn_t ret;
> +
> + ret = (*action)->handler(irq, (*action)->dev_id);
> + if (ret == IRQ_HANDLED)
> + *status |= (*action)->flags;
> + *retval |= ret;
> + *action = (*action)->next;
> + return ret;
> +}
> +
> static irqreturn_t _handle_IRQ_event(unsigned int irq, struct irqaction *action)
> {
> irqreturn_t ret, retval = IRQ_NONE;
> @@ -324,13 +345,12 @@ static irqreturn_t _handle_IRQ_event(uns
> if (!(action->flags & IRQF_DISABLED))
> local_irq_enable_in_hardirq();
>
> - do {
> - ret = action->handler(irq, action->dev_id);
> - if (ret == IRQ_HANDLED)
> - status |= action->flags;
> - retval |= ret;
> - action = action->next;
> - } while (action);
> + ret = __handle_irq_next_handler(irq, &action, &retval, &status);
> +
> + while (action) {
> + trace_irq_next_handler(irq, action, ret);
> + ret = __handle_irq_next_handler(irq, &action, &retval, &status);
> + }

Hm, this is rather unclean. Why open-code the first handler
execution?

This is a sign (and side effect) of the logical model being slightly
incorrect - see my previous mail to Jason.

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/