]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
net/: sparse fixes
authorKim Phillips <kim.phillips@freescale.com>
Mon, 29 Oct 2012 13:34:33 +0000 (13:34 +0000)
committerTom Rini <trini@ti.com>
Sun, 4 Nov 2012 18:00:36 +0000 (11:00 -0700)
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 <kim.phillips@freescale.com>
common/update.c
drivers/net/phy/atheros.c
include/net.h
net/arp.c
net/bootp.c
net/net.c
net/ping.h
net/tftp.h

index 5b1a064c29cba71d2337504eb30fd0a6811d8ecd..94d6a82aeb1b19478c07706419334815ac15d8e5 100644 (file)
@@ -37,6 +37,7 @@
 #include <command.h>
 #include <flash.h>
 #include <net.h>
+#include <net/tftp.h>
 #include <malloc.h>
 
 /* env variable holding the location of the update file */
index 798473dd68c9aa9b828effd8ab4d009818b4c224..9b3808bfa921cca0514f91ae6b74d2e2de3e9cb7 100644 (file)
@@ -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,
index 35393366d333b5143aefff3bd3dac7898b0c7b47..970d4d1fab13df2c093062e1cf015625bb5db558 100644 (file)
@@ -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;
 }
index 8e1d2edd6207a43e4ad16a5d42a3aad8147427ce..20c6b2d42ac0f6d90804de2d2e59fd0271da663b 100644 (file)
--- a/net/arp.c
+++ b/net/arp.c
 #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)
 {
index cd5c5dd1d74b3d63b485804b152eb29e35cd8708..4300f1c2f19a7e09b947d0bc5df9079bd9ac4db6 100644 (file)
@@ -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);
 
index 569fec41e73efca6f033b6a7cef6464bf87accf7..82c4cc91179a547f14887c8d1f5e1cf13f84a5af 100644 (file)
--- 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];
index fd8d8d9778b94b658b15c4e0c0c3f98abf00f5a3..8c71be4fdf069a43be5058baaadd1aa20b8b062c 100644 (file)
@@ -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
index 18e4c9c25d72debace773afa62e873ba372c62fd..2b686e3ca6a0d52778fedb66706f9882c19855ac 100644 (file)
@@ -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__ */