[PATCH 2/4] libata-core.c: add another IRQ calls
Jeff Garzik
jeff at garzik.org
Thu Jan 18 03:49:34 EST 2007
Mikael Pettersson wrote:
> If there is a highly common case, the code for that case
> is available, and the code is cheap to execute (doesn't
> require too many additional variables), then having an
> explicit test + inline code is preferred. If any of these
> conditions isn't met, then I wouldn't bother converting
> the call to the if/inline/call combo.
To be a bit more specific, the branch being taken, or not, depends on
the system setup. For example, in sata_promise's case, with no other
SATA controllers in use,
if (ap->ops->irq_on)
ap->ops->irq_on(ap);
else
ata_irq_on(ap);
the direct function call will ALWAYS be called. But if you had a weird
system with both Cell and Promise PDC203xx, then the branch is dependent
on whether the activity comes from the Cell SATA or Promise SATA.
So it's highly predictable in a great many cases.
And it should be noted that it is a direct function call not inline,
thus its if/indirect/direct not if/indirect/inline.
Does that change the answer at all?
Jeff
More information about the Linuxppc-dev
mailing list