From patchwork Wed May 11 13:59:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 95148 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 6D06CB6FC1 for ; Thu, 12 May 2011 00:01:16 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8D0D028095; Wed, 11 May 2011 16:01:07 +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 sgXytDwPqCIZ; Wed, 11 May 2011 16:01:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3E75280A4; Wed, 11 May 2011 16:00:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5895D2808F for ; Wed, 11 May 2011 16:00:39 +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 hdlTf8Og1rmV for ; Wed, 11 May 2011 16:00:36 +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 adserver.comelit.it (mail.comelit.it [217.56.59.218]) by theia.denx.de (Postfix) with ESMTP id BEC5628090 for ; Wed, 11 May 2011 16:00:35 +0200 (CEST) Received: from com-exc-01.comelit.it ([172.24.0.31]) by adserver.comelit.it with Microsoft SMTPSVC(6.0.3790.1830); Wed, 11 May 2011 15:59:34 +0200 Received: from wallace.comelit.it ([172.20.0.35]) by com-exc-01.comelit.it with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 May 2011 16:00:32 +0200 From: Luca Ceresoli To: u-boot@lists.denx.de Date: Wed, 11 May 2011 15:59:55 +0200 Message-Id: <1305122401-14967-3-git-send-email-luca.ceresoli@comelit.it> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1304512847-7351-1-git-send-email-luca.ceresoli@comelit.it> References: <1304512847-7351-1-git-send-email-luca.ceresoli@comelit.it> X-OriginalArrivalTime: 11 May 2011 14:00:32.0960 (UTC) FILETIME=[CB4B3C00:01CC0FE3] X-TM-AS-Product-Ver: SMEX-8.6.0.1168-6.500.1024-18128.004 X-TM-AS-Result: No--5.971600-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Cc: Luca Ceresoli , biggerbadderben@gmail.com Subject: [U-Boot] [PATCH v2 2/8] net/net.c: cosmetic: variable initializations X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 This removes the following checkpatch errors: - ERROR: do not initialise globals to 0 or NULL - ERROR: spaces required around that '=' (ctx:VxV) - ERROR: that open brace { should be on the previous line Signed-off-by: Luca Ceresoli Cc: Wolfgang Denk Cc: Ben Warren Cc: Mike Frysinger --- Changes since v1: - re-fix array initializations (the fix in v1 was worse than the original). net/net.c | 40 ++++++++++++++++++---------------------- 1 files changed, 18 insertions(+), 22 deletions(-) diff --git a/net/net.c b/net/net.c index 6e3af5b..4715699 100644 --- a/net/net.c +++ b/net/net.c @@ -117,23 +117,23 @@ DECLARE_GLOBAL_DATA_PTR; /** BOOTP EXTENTIONS **/ /* Our subnet mask (0=unknown) */ -IPaddr_t NetOurSubnetMask=0; +IPaddr_t NetOurSubnetMask; /* Our gateways IP address */ -IPaddr_t NetOurGatewayIP=0; +IPaddr_t NetOurGatewayIP; /* Our DNS IP address */ -IPaddr_t NetOurDNSIP=0; +IPaddr_t NetOurDNSIP; #if defined(CONFIG_BOOTP_DNS2) /* Our 2nd DNS IP address */ -IPaddr_t NetOurDNS2IP=0; +IPaddr_t NetOurDNS2IP; #endif /* Our NIS domain */ -char NetOurNISDomain[32]={0,}; +char NetOurNISDomain[32] = {0,}; /* Our hostname */ -char NetOurHostName[32]={0,}; +char NetOurHostName[32] = {0,}; /* Our bootpath */ -char NetOurRootPath[64]={0,}; +char NetOurRootPath[64] = {0,}; /* Our bootfile size in blocks */ -ushort NetBootFileSize=0; +ushort NetBootFileSize; #ifdef CONFIG_MCAST_TFTP /* Multicast TFTP */ IPaddr_t Mcast_addr; @@ -146,8 +146,7 @@ ulong NetBootFileXferSize; /* Our ethernet address */ uchar NetOurEther[6]; /* Boot server enet address */ -uchar NetServerEther[6] = - { 0, 0, 0, 0, 0, 0 }; +uchar NetServerEther[6]; /* Our IP addr (0 = unknown) */ IPaddr_t NetOurIP; /* Server IP addr (0 = unknown) */ @@ -159,27 +158,24 @@ int NetRxPacketLen; /* IP packet ID */ unsigned NetIPID; /* Ethernet bcast address */ -uchar NetBcastAddr[6] = - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -uchar NetEtherNullAddr[6] = - { 0, 0, 0, 0, 0, 0 }; +uchar NetBcastAddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +uchar NetEtherNullAddr[6]; #ifdef CONFIG_API void (*push_packet)(volatile void *, int len) = 0; #endif #if defined(CONFIG_CMD_CDP) /* Ethernet bcast address */ -uchar NetCDPAddr[6] = - { 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc }; +uchar NetCDPAddr[6] = { 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc }; #endif /* Network loop state */ int NetState; #ifdef CONFIG_NET_MULTI /* Tried all network devices */ -int NetRestartWrap = 0; +int NetRestartWrap; /* Network loop restarted */ -static int NetRestarted = 0; +static int NetRestarted; /* At least one device configured */ -static int NetDevExists = 0; +static int NetDevExists; #endif /* XXX in both little & big endian machines 0xFFFF == ntohs(-1) */ @@ -206,7 +202,7 @@ static void CDPStart(void); /* NTP server IP address */ IPaddr_t NetNtpServerIP; /* offset time from UTC */ -int NetTimeOffset=0; +int NetTimeOffset; #endif #ifdef CONFIG_NETCONSOLE @@ -228,7 +224,7 @@ static ulong timeStart; /* Current timeout value */ static ulong timeDelta; /* THE transmit packet */ -volatile uchar *NetTxPacket = 0; +volatile uchar *NetTxPacket; static int net_check_prereq (proto_t protocol); @@ -319,7 +315,7 @@ void ArpTimeoutCheck(void) static void NetInitLoop(proto_t protocol) { - static int env_changed_id = 0; + static int env_changed_id; bd_t *bd = gd->bd; int env_id = get_env_id ();