Date: Fri, 21 Apr 2006 21:13:52 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95827 for review Message-ID: <200604212113.k3LLDq6n094290@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95827 Change 95827 by imp@imp_hammer on 2006/04/21 21:13:17 Apply SWAP16 to constants rather than non-constants. This saves another 70ish bytes Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#8 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#8 (text+ko) ==== @@ -147,7 +147,7 @@ udpHdr = (udp_header_t*)(ipHdr + 1); - udpHdr->src_port = SWAP16(localPort); + udpHdr->src_port = localPort; udpHdr->dst_port = serverPort; udpHdr->udp_len = SWAP16(8 + tftpLength); udpHdr->udp_cksum = 0; @@ -324,14 +324,14 @@ udpHdr = (udp_header_t*)((char*)pIpHeader+20); tftpHdr = (tftp_header_t*)((char*)udpHdr + 8); - if (SWAP16(udpHdr->dst_port) != localPort) + if (udpHdr->dst_port != localPort) break; - if (SWAP16(tftpHdr->opcode) != TFTP_DATA_OPCODE) + if (tftpHdr->opcode != SWAP16(TFTP_DATA_OPCODE)) break; if (ackBlock == -1) { - if (SWAP16(tftpHdr->block_num) != 1) + if (tftpHdr->block_num != SWAP16(1)) break; serverPort = udpHdr->src_port; ackBlock = 0; @@ -667,7 +667,7 @@ serverMACSet = 0; localIPSet = 0; serverIPSet = 0; - localPort = 0x8002; + localPort = SWAP16(0x8002); lastAddress = 0; lastSize = 0; MAC_init = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604212113.k3LLDq6n094290>