Jeff Garzik wrote:
> saeed bishara wrote:
>> -    if (unlikely(irq_stat & PCI_ERR)) {
>> +    if (unlikely(irq_stat & PCI_ERR) && HAS_PCI(host)) {
>>          mv_pci_error(host, mmio);
>>          handled = 1;
>>          goto out_unlock;    /* skip all other HC irq handling */
> 
> the unlikely() should cover the entire expression.

Hmm... I also sometimes hesitate about these things.  I think when the
first condition is unlikely but the latter isn't so, it's better to tell
the compiler that the first part is unlikely and let it figure out the
rest.  Another thing is using unlikely on the return value of helper
function like the following.

static bool test_some_condition(arg)
{
        return unlikely(unlikely_test_on_arg(arg));
}

I haven't looked at the generated code yet but hope the compiler can
DTRT if the function body is visible when compiling.  Has anyone played
with these?

Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to