From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David Laight" Subject: RE: [PATCH v2] gianfar: Fall back to software tcp/udp checksum on oldercontrollers Date: Fri, 28 Jan 2011 09:10:46 -0000 Message-ID: References: <640295.36173.qm@web37608.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Return-path: Content-class: urn:content-classes:message In-Reply-To: <640295.36173.qm@web37608.mail.mud.yahoo.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org List-Id: netdev.vger.kernel.org > + 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. David From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0.aculab.com (mx0.aculab.com [213.249.233.131]) by ozlabs.org (Postfix) with SMTP id 90F431007D1 for ; Fri, 28 Jan 2011 20:13:02 +1100 (EST) Received: from mx0.aculab.com ([127.0.0.1]) by localhost (mx0.aculab.com [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 00750-05 for ; Fri, 28 Jan 2011 09:12:59 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: [PATCH v2] gianfar: Fall back to software tcp/udp checksum on oldercontrollers Date: Fri, 28 Jan 2011 09:10:46 -0000 Message-ID: In-Reply-To: <640295.36173.qm@web37608.mail.mud.yahoo.com> From: "David Laight" Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , =20 > + 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. David