diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-09-30 10:24:10 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-05 08:50:14 -0700 |
commit | 2a953cfd42c00bab00e792422f7c2064c5f0b410 (patch) | |
tree | b778ac83e76de8c5c5644e5061cc19b649f5e8cf /drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | |
parent | 7cfd8a3720c0d266e402c5f6c688a63c213491df (diff) |
staging/ft1000-usb: fix problems found by sparse
In the original code, address space annotations are missing,
which hides a possible unchecked user pointer access.
Two functions use a lot of stack space.
Extern declarations are all in the wrong place, which leads
to type differences between caller and callee in some cases.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/ft1000/ft1000-usb/ft1000_usb.c')
-rw-r--r-- | drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c index f708c091e5c..4aef1c43e61 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c @@ -33,7 +33,7 @@ MODULE_SUPPORTED_DEVICE("QFT FT1000 Express Cards"); void *pFileStart; -ULONG FileLength; +size_t FileLength; #define VENDOR_ID 0x1291 /* Qualcomm vendor id */ #define PRODUCT_ID 0x11 /* fake product id */ @@ -46,24 +46,7 @@ static struct usb_device_id id_table[] = { MODULE_DEVICE_TABLE (usb, id_table); -extern struct ft1000_device *pdevobj[MAX_NUM_CARDS+2]; - -char *getfw (char *fn, int *pimgsz); - -int ft1000_close(struct net_device *net); -void dsp_reload (struct ft1000_device *ft1000dev); -u16 init_ft1000_netdev(struct ft1000_device *ft1000dev); -u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *intf); -int ft1000_poll(void* dev_id); -void ft1000_DestroyDevice(struct net_device *dev); -u16 ft1000_read_dpram16(struct ft1000_device *ft1000dev, USHORT indx, PUCHAR buffer, u8 highlow); -u16 ft1000_read_register(struct ft1000_device *ft1000dev, short* Data, u16 nRegIndx); -BOOLEAN gPollingfailed = FALSE; - -void ft1000InitProc(struct net_device *dev); -void ft1000CleanupProc(FT1000_INFO *info); -int ft1000_poll_thread(void *arg); - +static BOOLEAN gPollingfailed = FALSE; int ft1000_poll_thread(void *arg) { int ret = STATUS_SUCCESS; |