From eb93ca4e83ecf06a94a36571be730a98177c8e14 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Mon, 8 Aug 2011 11:31:48 -0700 Subject: [PATCH] staging: fix ft1000 sparse warnings Fix sparse warnings in staging/ft1000/: drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:69:7: warning: obsolete struct initializer, use C99 syntax and make many functions & data static. Examples: drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:65:23: warning: symbol 'fw_entry' was not declared. Should it be static? drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:836:6: warning: symbol 'ft1000_send_cmd' was not declared. Should it be static? drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:1014:6: warning: symbol 'ft1000_proc_drvmsg' was not declared. Should it be static? drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:1788:5: warning: symbol 'ft1000_copy_down_pkt' was not declared. Should it be static? drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:2096:6: warning: symbol 'stop_ft1000_card' was not declared. Should it be static? drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:2155:19: warning: symbol 'init_ft1000_card' was not declared. Should it be static? rivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c:172:5: warning: symbol 'ft1000_confcheck' was not declared. Should it be static? drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:50:5: warning: symbol 'ft1000ReadProc' was not declared. Should it be static? drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:194:6: warning: symbol 'ft1000InitProc' was not declared. Should it be static? drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:207:6: warning: symbol 'ft1000CleanupProc' was not declared. Should it be static? Signed-off-by: Randy Dunlap Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ft1000/ft1000-pcmcia/ft1000.h | 10 ++++++++ .../staging/ft1000/ft1000-pcmcia/ft1000_cs.c | 8 +++---- .../ft1000/ft1000-pcmcia/ft1000_dnld.c | 3 ++- .../staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 24 ++++++++----------- .../ft1000/ft1000-pcmcia/ft1000_proc.c | 4 ++-- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000.h b/drivers/staging/ft1000/ft1000-pcmcia/ft1000.h index 3b0130fe6083..adb436ed2511 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000.h +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000.h @@ -68,6 +68,16 @@ struct ft1000_info { char netdevname[IFNAMSIZ]; }; +struct pcmcia_device; +struct net_device; +extern struct net_device *init_ft1000_card(struct pcmcia_device *link, + void *ft1000_reset); +extern void stop_ft1000_card(struct net_device *dev); +extern int card_download(struct net_device *dev, const u8 *pFileStart, + size_t FileLength); +extern void ft1000InitProc(struct net_device *dev); +extern void ft1000CleanupProc(struct net_device *dev); + extern u16 ft1000_read_dpram(struct net_device *dev, int offset); extern void card_bootload(struct net_device *dev); extern u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, int Index); diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c index 6a1c1d4dcca2..f376ca43720d 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c @@ -41,14 +41,12 @@ MODULE_LICENSE("GPL"); /*====================================================================*/ -struct net_device *init_ft1000_card(struct pcmcia_device *link, - void *ft1000_reset); -void stop_ft1000_card(struct net_device *); - static int ft1000_config(struct pcmcia_device *link); static void ft1000_detach(struct pcmcia_device *link); static int ft1000_attach(struct pcmcia_device *link); +#include "ft1000.h" + /*====================================================================*/ static void ft1000_reset(struct pcmcia_device *link) @@ -75,7 +73,7 @@ static void ft1000_detach(struct pcmcia_device *link) free_netdev(dev); } -int ft1000_confcheck(struct pcmcia_device *link, void *priv_data) +static int ft1000_confcheck(struct pcmcia_device *link, void *priv_data) { return pcmcia_request_io(link); } diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c index c956857e2d58..f8b8e71284d9 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c @@ -287,7 +287,8 @@ u16 hdr_checksum(struct pseudo_hdr *pHdr) return chksum; } -int card_download(struct net_device *dev, const u8 *pFileStart, u32 FileLength) +int card_download(struct net_device *dev, const u8 *pFileStart, + size_t FileLength) { struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev); int Status = SUCCESS; diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c index 990b2afb3d6b..b3d743a3d308 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c @@ -56,16 +56,11 @@ #include #include "ft1000.h" -int card_download(struct net_device *dev, const u8 *pFileStart, u32 FileLength); - -void ft1000InitProc(struct net_device *dev); -void ft1000CleanupProc(struct net_device *dev); - -const struct firmware *fw_entry; +static const struct firmware *fw_entry; static void ft1000_hbchk(u_long data); static struct timer_list poll_timer = { - function:ft1000_hbchk + .function = ft1000_hbchk }; static u16 cmdbuffer[1024]; @@ -788,7 +783,7 @@ static void ft1000_hbchk(u_long data) // Output: // //--------------------------------------------------------------------------- -void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qtype) +static void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qtype) { struct ft1000_info *info = netdev_priv(dev); int i; @@ -873,7 +868,8 @@ void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qt // = 1 (successful) // //--------------------------------------------------------------------------- -bool ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 *pnxtph) +static bool ft1000_receive_cmd(struct net_device *dev, u16 *pbuffer, + int maxsz, u16 *pnxtph) { struct ft1000_info *info = netdev_priv(dev); u16 size; @@ -966,7 +962,7 @@ bool ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 *p // none // //--------------------------------------------------------------------------- -void ft1000_proc_drvmsg(struct net_device *dev) +static void ft1000_proc_drvmsg(struct net_device *dev) { struct ft1000_info *info = netdev_priv(dev); u16 msgtype; @@ -1245,7 +1241,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) // SUCCESS // //--------------------------------------------------------------------------- -int ft1000_parse_dpram_msg(struct net_device *dev) +static int ft1000_parse_dpram_msg(struct net_device *dev) { struct ft1000_info *info = netdev_priv(dev); u16 doorbell; @@ -1546,7 +1542,7 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) // SUCCESS // //--------------------------------------------------------------------------- -int ft1000_copy_up_pkt(struct net_device *dev) +static int ft1000_copy_up_pkt(struct net_device *dev) { u16 tempword; struct ft1000_info *info = netdev_priv(dev); @@ -1734,7 +1730,7 @@ int ft1000_copy_up_pkt(struct net_device *dev) // SUCCESS // //--------------------------------------------------------------------------- -int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len) +static int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len) { struct ft1000_info *info = netdev_priv(dev); union { @@ -2102,7 +2098,7 @@ static const struct ethtool_ops ops = { }; struct net_device *init_ft1000_card(struct pcmcia_device *link, - void *ft1000_reset) + void *ft1000_reset) { struct ft1000_info *info; struct net_device *dev; diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c index 9e728b3415e3..7faeadad1fff 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c @@ -48,8 +48,8 @@ } \ len += snprintf(page+len, PAGE_SIZE - len, "%d\n", var[i]) -int ft1000ReadProc(char *page, char **start, off_t off, - int count, int *eof, void *data) +static int ft1000ReadProc(char *page, char **start, off_t off, + int count, int *eof, void *data) { struct net_device *dev; int len;