From owner-p4-projects@FreeBSD.ORG Fri Apr 21 21:35:21 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 0709F16A402; Fri, 21 Apr 2006 21:35:21 +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 C037416A400 for ; Fri, 21 Apr 2006 21:35:20 +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 8B80543D45 for ; Fri, 21 Apr 2006 21:35:20 +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 k3LLZK8Q006395 for ; Fri, 21 Apr 2006 21:35:20 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3LLZKc2006389 for perforce@freebsd.org; Fri, 21 Apr 2006 21:35:20 GMT (envelope-from imp@freebsd.org) Date: Fri, 21 Apr 2006 21:35:20 GMT Message-Id: <200604212135.k3LLZKc2006389@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 95830 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: Fri, 21 Apr 2006 21:35:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=95830 Change 95830 by imp@imp_hammer on 2006/04/21 21:34:20 A few more SWAP16(const) in preference to SWAP16(var) Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#10 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#10 (text+ko) ==== @@ -260,12 +260,10 @@ pFrameType = (unsigned short *) ((p_rxBD[i].address & 0xFFFFFFFC) + 12); pData = (char *)(p_rxBD[i].address & 0xFFFFFFFC); - switch (SWAP16(*pFrameType)) { + switch (*pFrameType) { - case PROTOCOL_ARP: - + case SWAP16(PROTOCOL_ARP): p_ARP = (arp_header_t*)pData; - if (p_ARP->operation == SWAP16(ARP_REPLY)) { // check if new server info is available if ((!serverMACSet) && @@ -303,16 +301,12 @@ *AT91C_EMAC_TAR = (unsigned)pData; *AT91C_EMAC_TCR = 0x40; } - break; - - case PROTOCOL_IP: + break; + case SWAP16(PROTOCOL_IP): pIpHeader = (ip_header_t*)(pData + 14); p_memcpy((char*)pHeader, (char*)pIpHeader,sizeof(ip_header_t)); - switch(pIpHeader->ip_p) { - - case PROTOCOL_UDP: - { + if (pIpHeader->ip_p == PROTOCOL_UDP) { udp_header_t *udpHdr; tftp_header_t *tftpHdr; @@ -337,17 +331,8 @@ TFTP_ACK_Data(tftpHdr->data, SWAP16(tftpHdr->block_num), - SWAP16(udpHdr->udp_len) - 12); + SWAP16(udpHdr->udp_len) - 12); } - break; - - default: - break; - } - break; - - default: - break; } p_rxBD[process].address &= ~0x01; }