Date: Fri, 21 Apr 2006 21:35:20 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95830 for review Message-ID: <200604212135.k3LLZKc2006389@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604212135.k3LLZKc2006389>