From patchwork Wed May 23 17:58:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Hershberger X-Patchwork-Id: 160993 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 410F9B6FBB for ; Thu, 24 May 2012 04:01:35 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 88EA2280C3; Wed, 23 May 2012 20:00:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2KRO1rtHXCAr; Wed, 23 May 2012 20:00:26 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1ECCF280F6; Wed, 23 May 2012 19:58:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 81E8E280AB for ; Wed, 23 May 2012 19:58:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aKhEOdFk6qI6 for ; Wed, 23 May 2012 19:58:27 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from spamkiller05.natinst.com (mailserver5.natinst.com [130.164.80.5]) by theia.denx.de (Postfix) with ESMTP id 103C22809C for ; Wed, 23 May 2012 19:58:19 +0200 (CEST) Received: from mailserv58-us.natinst.com (nb-hsrp-1338.natinst.com [130.164.19.133]) by spamkiller05.natinst.com (8.14.4/8.14.4) with ESMTP id q4NHwIQV006970; Wed, 23 May 2012 12:58:18 -0500 Received: from localhost.localdomain ([130.164.14.197]) by mailserv58-us.natinst.com (Lotus Domino Release 8.5.2FP3) with ESMTP id 2012052312581839-530917 ; Wed, 23 May 2012 12:58:18 -0500 From: Joe Hershberger To: u-boot@lists.denx.de Date: Wed, 23 May 2012 12:58:09 -0500 Message-Id: <1337795897-19231-14-git-send-email-joe.hershberger@ni.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1332891772-17279-1-git-send-email-joe.hershberger@ni.com> References: <1332891772-17279-1-git-send-email-joe.hershberger@ni.com> X-MIMETrack: Itemize by SMTP Server on MailServ58-US/AUS/H/NIC(Release 8.5.2FP3|July 10, 2011) at 05/23/2012 12:58:18 PM, Serialize by Router on MailServ58-US/AUS/H/NIC(Release 8.5.2FP3|July 10, 2011) at 05/23/2012 12:58:18 PM, Serialize complete at 05/23/2012 12:58:18 PM X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7724, 1.0.260, 0.0.0000 definitions=2012-05-23_01:2012-05-23, 2012-05-22, 1970-01-01 signatures=0 Cc: Joe Hershberger Subject: [U-Boot] [PATCH v3 13/21] net: cosmetic: Un-typedef ICMP_t X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Remove typedef and lower-case name Signed-off-by: Joe Hershberger Cc: Joe Hershberger --- Changes for v2: - Split apart from "Un-typedef variables in net" - Renamed structs from *_t to *_hdr since they are nolonger types Changes for v3: - Renamed ICMP_hdr to icmp_hdr - Removed extra brackets include/net.h | 6 ++++-- net/net.c | 2 +- net/ping.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/net.h b/include/net.h index eeea466..fd19c42 100644 --- a/include/net.h +++ b/include/net.h @@ -298,7 +298,7 @@ struct arp_hdr { /* Codes for NOT_REACH */ #define ICMP_NOT_REACH_PORT 3 /* Port unreachable */ -typedef struct icmphdr { +struct icmp_hdr { uchar type; uchar code; ushort checksum; @@ -314,8 +314,10 @@ typedef struct icmphdr { } frag; uchar data[0]; } un; -} ICMP_t; +}; +#define ICMP_HDR_SIZE (sizeof(struct icmp_hdr)) +#define IP_ICMP_HDR_SIZE (IP_HDR_SIZE + ICMP_HDR_SIZE) /* * Maximum packet size; used to allocate packet storage. diff --git a/net/net.c b/net/net.c index 6d34254..4cdd9cd 100644 --- a/net/net.c +++ b/net/net.c @@ -825,7 +825,7 @@ static inline struct ip_udp_hdr *NetDefragment(struct ip_udp_hdr *ip, int *lenp) static void receive_icmp(struct ip_udp_hdr *ip, int len, IPaddr_t src_ip, struct ethernet_hdr *et) { - ICMP_t *icmph = (ICMP_t *)&ip->udp_src; + struct icmp_hdr *icmph = (struct icmp_hdr *)&ip->udp_src; switch (icmph->type) { case ICMP_REDIRECT: diff --git a/net/ping.c b/net/ping.c index 04a594c..3102521 100644 --- a/net/ping.c +++ b/net/ping.c @@ -100,7 +100,7 @@ void ping_start(void) void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) { - ICMP_t *icmph = (ICMP_t *)&(ip->udp_src); + struct icmp_hdr *icmph = (struct icmp_hdr *)&ip->udp_src; IPaddr_t src_ip; switch (icmph->type) {