From owner-p4-projects@FreeBSD.ORG Wed May 3 19:37:52 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8F28016A41F; Wed, 3 May 2006 19:37:52 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 50E0516A401 for ; Wed, 3 May 2006 19:37:52 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F25E43D8B for ; Wed, 3 May 2006 19:37:51 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k43Jbp6W094242 for ; Wed, 3 May 2006 19:37:51 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k43Jbpc7094229 for perforce@freebsd.org; Wed, 3 May 2006 19:37:51 GMT (envelope-from imp@freebsd.org) Date: Wed, 3 May 2006 19:37:51 GMT Message-Id: <200605031937.k43Jbpc7094229@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 96608 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 May 2006 19:37:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=96608 Change 96608 by imp@imp_hammer on 2006/05/03 19:37:50 Save about 40 bytes by not being stupid. Note: The register that's being read is specific to some board that isn't this board, so some care needs to be taken in fixing this right... Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#11 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#11 (text+ko) ==== @@ -367,27 +367,17 @@ MII_GetLinkSpeed(AT91PS_EMAC pEmac) { unsigned short stat2; - unsigned update = 0; + unsigned update; stat2 = AT91F_MII_ReadPhy(pEmac, MII_STS2_REG); - - if (!(stat2 & 0x400)) { + if (!(stat2 & 0x400)) return ; - - } else if (stat2 & 0x4000) { - + update = pEmac->EMAC_CFG & ~(AT91C_EMAC_SPD | AT91C_EMAC_FD); + if (stat2 & 0x4000) update |= AT91C_EMAC_SPD; - - if (stat2 & 0x200) { - update |= AT91C_EMAC_FD; - } - - } else if (stat2 & 0x200) { + if (stat2 & 0x200) update |= AT91C_EMAC_FD; - } - - pEmac->EMAC_CFG = - (pEmac->EMAC_CFG & ~(AT91C_EMAC_SPD | AT91C_EMAC_FD)) | update; + pEmac->EMAC_CFG = update; }