From patchwork Mon Oct 29 23:34:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 195158 X-Patchwork-Delegate: trini@ti.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 EE3D62C0097 for ; Tue, 30 Oct 2012 10:39:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 51C084A210; Tue, 30 Oct 2012 00:39:16 +0100 (CET) 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 wyXu2dMA3eCg; Tue, 30 Oct 2012 00:39:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 99AAD4A0EE; Tue, 30 Oct 2012 00:37:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE1394A0AA for ; Tue, 30 Oct 2012 00:37:26 +0100 (CET) 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 Ki0FXFvs3h7H for ; Tue, 30 Oct 2012 00:37:23 +0100 (CET) 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 am1outboundpool.messaging.microsoft.com (am1ehsobe001.messaging.microsoft.com [213.199.154.204]) by theia.denx.de (Postfix) with ESMTPS id 4518A4A033 for ; Tue, 30 Oct 2012 00:37:16 +0100 (CET) Received: from mail51-am1-R.bigfish.com (10.3.201.241) by AM1EHSOBE010.bigfish.com (10.3.204.30) with Microsoft SMTP Server id 14.1.225.23; Mon, 29 Oct 2012 23:37:13 +0000 Received: from mail51-am1 (localhost [127.0.0.1]) by mail51-am1-R.bigfish.com (Postfix) with ESMTP id 082D246014D for ; Mon, 29 Oct 2012 23:37:13 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1202h1d1ah1d2ahzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h1155h) Received: from mail51-am1 (localhost.localdomain [127.0.0.1]) by mail51-am1 (MessageSwitch) id 1351553830482404_31500; Mon, 29 Oct 2012 23:37:10 +0000 (UTC) Received: from AM1EHSMHS008.bigfish.com (unknown [10.3.201.247]) by mail51-am1.bigfish.com (Postfix) with ESMTP id 72D321E023D for ; Mon, 29 Oct 2012 23:37:10 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS008.bigfish.com (10.3.207.108) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 29 Oct 2012 23:37:10 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.318.3; Mon, 29 Oct 2012 23:37:08 +0000 Received: from x9.am.freescale.net (x9.am.freescale.net [10.82.120.9]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q9TNb5oo024985 for ; Mon, 29 Oct 2012 16:37:08 -0700 From: Kim Phillips To: Date: Mon, 29 Oct 2012 18:34:33 -0500 Message-ID: <1351553687-12469-12-git-send-email-kim.phillips@freescale.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1351553687-12469-1-git-send-email-kim.phillips@freescale.com> References: <1351553687-12469-1-git-send-email-kim.phillips@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH v2 11/25] net/: sparse fixes 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de bootp.c:44:14: warning: symbol 'dhcp_state' was not declared. Should it be static? bootp.c:45:15: warning: symbol 'dhcp_leasetime' was not declared. Should it be static? bootp.c:46:10: warning: symbol 'NetDHCPServerIP' was not declared. Should it be static? arp.c:30:17: warning: symbol 'NetArpWaitReplyIP' was not declared. Should it be static? arp.c:37:16: warning: symbol 'NetArpTxPacket' was not declared. Should it be static? arp.c:38:17: warning: symbol 'NetArpPacketBuf' was not declared. Should it be static? atheros.c:33:19: warning: symbol 'AR8021_driver' was not declared. Should it be static? net.c:183:7: warning: symbol 'PktBuf' was not declared. Should it be static? net.c:159:21: warning: symbol 'net_state' was not declared. Should it be static? ping.c:73:6: warning: symbol 'ping_start' was not declared. Should it be static? ping.c:82:13: warning: symbol 'ping_receive' was not declared. Should it be static? tftp.c:53:7: warning: symbol 'TftpRRQTimeoutMSecs' was not declared. Should it be static? tftp.c:54:5: warning: symbol 'TftpRRQTimeoutCountMax' was not declared. Should it be static? eth.c:125:19: warning: symbol 'eth_current' was not declared. Should it be static? Note: in the ping.c fix, commit a36b12f95a29647a06b5459198684fc142482020 "net: Move PING out of net.c" mistakenly carried the ifdef CMD_PING clause from when it was necessary to avoid warnings when it was embedded in net.c. Signed-off-by: Kim Phillips --- v2: no changes common/update.c | 1 + drivers/net/phy/atheros.c | 2 +- include/net.h | 9 +++++---- net/arp.c | 6 +++--- net/bootp.c | 6 +++--- net/net.c | 2 +- net/ping.h | 3 --- net/tftp.h | 3 +++ 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/common/update.c b/common/update.c index 5b1a064..94d6a82 100644 --- a/common/update.c +++ b/common/update.c @@ -37,6 +37,7 @@ #include #include #include +#include #include /* env variable holding the location of the update file */ diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c index 798473d..9b3808b 100644 --- a/drivers/net/phy/atheros.c +++ b/drivers/net/phy/atheros.c @@ -30,7 +30,7 @@ static int ar8021_config(struct phy_device *phydev) return 0; } -struct phy_driver AR8021_driver = { +static struct phy_driver AR8021_driver = { .name = "AR8021", .uid = 0x4dd040, .mask = 0xfffff0, diff --git a/include/net.h b/include/net.h index 3539336..970d4d1 100644 --- a/include/net.h +++ b/include/net.h @@ -102,12 +102,13 @@ extern int eth_register(struct eth_device* dev);/* Register network device */ extern int eth_unregister(struct eth_device *dev);/* Remove network device */ extern void eth_try_another(int first_restart); /* Change the device */ extern void eth_set_current(void); /* set nterface to ethcur var */ + /* get the current device MAC */ +extern struct eth_device *eth_current; + static inline __attribute__((always_inline)) struct eth_device *eth_get_dev(void) { - extern struct eth_device *eth_current; - return eth_current; } extern struct eth_device *eth_get_dev_by_name(const char *devname); @@ -517,10 +518,10 @@ enum net_loop_state { NETLOOP_SUCCESS, NETLOOP_FAIL }; +extern enum net_loop_state net_state; + static inline void net_set_state(enum net_loop_state state) { - extern enum net_loop_state net_state; - debug_cond(DEBUG_INT_STATE, "--- NetState set to %d\n", state); net_state = state; } diff --git a/net/arp.c b/net/arp.c index 8e1d2ed..20c6b2d 100644 --- a/net/arp.c +++ b/net/arp.c @@ -27,15 +27,15 @@ #endif IPaddr_t NetArpWaitPacketIP; -IPaddr_t NetArpWaitReplyIP; +static IPaddr_t NetArpWaitReplyIP; /* MAC address of waiting packet's destination */ uchar *NetArpWaitPacketMAC; int NetArpWaitTxPacketSize; ulong NetArpWaitTimerStart; int NetArpWaitTry; -uchar *NetArpTxPacket; /* THE ARP transmit packet */ -uchar NetArpPacketBuf[PKTSIZE_ALIGN + PKTALIGN]; +static uchar *NetArpTxPacket; /* THE ARP transmit packet */ +static uchar NetArpPacketBuf[PKTSIZE_ALIGN + PKTALIGN]; void ArpInit(void) { diff --git a/net/bootp.c b/net/bootp.c index cd5c5dd..4300f1c 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -41,9 +41,9 @@ ulong BootpID; int BootpTry; #if defined(CONFIG_CMD_DHCP) -dhcp_state_t dhcp_state = INIT; -unsigned long dhcp_leasetime; -IPaddr_t NetDHCPServerIP; +static dhcp_state_t dhcp_state = INIT; +static unsigned long dhcp_leasetime; +static IPaddr_t NetDHCPServerIP; static void DhcpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len); diff --git a/net/net.c b/net/net.c index 569fec4..82c4cc9 100644 --- a/net/net.c +++ b/net/net.c @@ -180,7 +180,7 @@ IPaddr_t NetNtpServerIP; int NetTimeOffset; #endif -uchar PktBuf[(PKTBUFSRX+1) * PKTSIZE_ALIGN + PKTALIGN]; +static uchar PktBuf[(PKTBUFSRX+1) * PKTSIZE_ALIGN + PKTALIGN]; /* Receive packet */ uchar *NetRxPackets[PKTBUFSRX]; diff --git a/net/ping.h b/net/ping.h index fd8d8d9..8c71be4 100644 --- a/net/ping.h +++ b/net/ping.h @@ -8,8 +8,6 @@ * Copyright 2000-2002 Wolfgang Denk, wd@denx.de */ -#if defined(CONFIG_CMD_PING) - #ifndef __PING_H__ #define __PING_H__ @@ -31,4 +29,3 @@ void ping_start(void); void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len); #endif /* __PING_H__ */ -#endif diff --git a/net/tftp.h b/net/tftp.h index 18e4c9c..2b686e3 100644 --- a/net/tftp.h +++ b/net/tftp.h @@ -22,6 +22,9 @@ void TftpStart(enum proto_t protocol); /* Begin TFTP get/put */ extern void TftpStartServer(void); /* Wait for incoming TFTP put */ #endif +extern ulong TftpRRQTimeoutMSecs; +extern int TftpRRQTimeoutCountMax; + /**********************************************************************/ #endif /* __TFTP_H__ */