diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-09-30 10:24:12 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-05 08:50:15 -0700 |
commit | 44a17eff844d92421c8b568c84df29735e1e45f9 (patch) | |
tree | 6ee56974122f2be7cb112a25c0ce032a268f28ec /drivers/staging/bcm/InterfaceInit.c | |
parent | 9f1c75ac2dba752ad3734bd3ffab805a6a3fbeda (diff) |
staging/bcm: add sparse annotations
This marks up the code where sparse complains in most cases.
Most of the changes are in the ioctl handling code, which
gets __user annotations, finding one unchecked user access.
The rest is mostly about marking functions static when they
are only used in one file.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/bcm/InterfaceInit.c')
-rw-r--r-- | drivers/staging/bcm/InterfaceInit.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/staging/bcm/InterfaceInit.c b/drivers/staging/bcm/InterfaceInit.c index 8bf900b88998..81523b1e4f08 100644 --- a/drivers/staging/bcm/InterfaceInit.c +++ b/drivers/staging/bcm/InterfaceInit.c @@ -68,12 +68,12 @@ static int usbbcm_release(struct inode *inode, struct file *file) return 0; } -static ssize_t usbbcm_read(struct file *file, char *buffer, size_t count, loff_t *ppos) +static ssize_t usbbcm_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) { return 0; } -static ssize_t usbbcm_write(struct file *file, const char *user_buffer, size_t count, loff_t *ppos) +static ssize_t usbbcm_write(struct file *file, const char __user *user_buffer, size_t count, loff_t *ppos) { return 0; } @@ -188,14 +188,12 @@ usbbcm_device_probe(struct usb_interface *intf, const struct usb_device_id *id) } /* Allocate Adapter structure */ - if((psAdapter = kmalloc(sizeof(MINI_ADAPTER), GFP_KERNEL)) == NULL) + if((psAdapter = kzalloc(sizeof(MINI_ADAPTER), GFP_KERNEL)) == NULL) { - //BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_PRINTK, 0, 0, "Out of memory"); + BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_PRINTK, 0, 0, "Out of memory"); return -ENOMEM; } - memset(psAdapter, 0, sizeof(MINI_ADAPTER)); - /* Init default driver debug state */ psAdapter->stDebugState.debug_level = DBG_LVL_CURR; @@ -618,9 +616,9 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) if((psIntfAdapter->bHighSpeedDevice == FALSE) && bcm_usb_endpoint_is_bulk_out(endpoint)) { // Once BULK is selected in FS mode. Revert it back to INT. Else USB_IF will fail. - UINT uiData = ntohl(EP2_CFG_INT); + UINT _uiData = ntohl(EP2_CFG_INT); BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Reverting Bulk to INT as it is FS MODE"); - BeceemEEPROMBulkWrite(psIntfAdapter->psAdapter,(PUCHAR)&uiData,0x136,4,TRUE); + BeceemEEPROMBulkWrite(psIntfAdapter->psAdapter,(PUCHAR)&_uiData,0x136,4,TRUE); } } else @@ -773,7 +771,8 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) return 0; } -int InterfaceSuspend (struct usb_interface *intf, pm_message_t message) + +static int InterfaceSuspend (struct usb_interface *intf, pm_message_t message) { PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf); BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "=================================\n"); @@ -802,7 +801,8 @@ int InterfaceSuspend (struct usb_interface *intf, pm_message_t message) return 0; } -int InterfaceResume (struct usb_interface *intf) + +static int InterfaceResume (struct usb_interface *intf) { PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf); printk("=================================\n"); @@ -816,12 +816,14 @@ int InterfaceResume (struct usb_interface *intf) InterfaceRx(psIntfAdapter); return 0; } -int InterfacePreReset(struct usb_interface *intf) + +static int InterfacePreReset(struct usb_interface *intf) { printk("====================>"); return STATUS_SUCCESS; } -int InterfacePostReset(struct usb_interface *intf) + +static int InterfacePostReset(struct usb_interface *intf) { printk("Do Post chip reset setting here if it is required"); return STATUS_SUCCESS; |