From: Scott Wood <scottw...@freescale.com>
Date: Fri, 28 Jan 2011 10:56:10 -0600

> On Fri, 28 Jan 2011 09:10:46 +0000
> David Laight <david.lai...@aculab.com> wrote:
> 
>>  
>> > +          if (unlikely(gfar_has_errata(priv, GFAR_ERRATA_12)
>> > +                       && ((unsigned long)fcb % 0x20) > 0x18)) {
>> 
>> You need to check the generated code, but I think you need:
>> 
>>     if (unlikely(gfar_has_errata(priv, GFAR_ERRATA_12))
>>           && unlikely(((unsigned long)fcb % 0x20) > 0x18))
>> 
>> ie unlikely() around both the primitive comparisons.
> 
> Is the first condition actually unlikely?  If you've got affected
> hardware, you'll hit it every time.
> 
> If packets with the problematic alignment are rare, seems like it'd be
> better to check that first.

In cases like this gfar_has_errata() case, better to leave it's
likelyhood unmarked.

And yes, since it's cheaper, checking the alignment should be done
first.
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to