USB: misc: Remove unnecessary casts of private_data
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e53e841d45
commit
5bd6e8b3fb
@@ -650,7 +650,7 @@ static int ftdi_elan_open(struct inode *inode, struct file *file)
|
|||||||
|
|
||||||
static int ftdi_elan_release(struct inode *inode, struct file *file)
|
static int ftdi_elan_release(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct usb_ftdi *ftdi = (struct usb_ftdi *)file->private_data;
|
struct usb_ftdi *ftdi = file->private_data;
|
||||||
if (ftdi == NULL)
|
if (ftdi == NULL)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
up(&ftdi->sw_lock); /* decrement the count on our device */
|
up(&ftdi->sw_lock); /* decrement the count on our device */
|
||||||
@@ -673,7 +673,7 @@ static ssize_t ftdi_elan_read(struct file *file, char __user *buffer,
|
|||||||
int bytes_read = 0;
|
int bytes_read = 0;
|
||||||
int retry_on_empty = 10;
|
int retry_on_empty = 10;
|
||||||
int retry_on_timeout = 5;
|
int retry_on_timeout = 5;
|
||||||
struct usb_ftdi *ftdi = (struct usb_ftdi *)file->private_data;
|
struct usb_ftdi *ftdi = file->private_data;
|
||||||
if (ftdi->disconnected > 0) {
|
if (ftdi->disconnected > 0) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
@@ -283,7 +283,7 @@ static ssize_t iowarrior_read(struct file *file, char __user *buffer,
|
|||||||
int read_idx;
|
int read_idx;
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
dev = (struct iowarrior *)file->private_data;
|
dev = file->private_data;
|
||||||
|
|
||||||
/* verify that the device wasn't unplugged */
|
/* verify that the device wasn't unplugged */
|
||||||
if (dev == NULL || !dev->present)
|
if (dev == NULL || !dev->present)
|
||||||
@@ -349,7 +349,7 @@ static ssize_t iowarrior_write(struct file *file,
|
|||||||
char *buf = NULL; /* for IOW24 and IOW56 we need a buffer */
|
char *buf = NULL; /* for IOW24 and IOW56 we need a buffer */
|
||||||
struct urb *int_out_urb = NULL;
|
struct urb *int_out_urb = NULL;
|
||||||
|
|
||||||
dev = (struct iowarrior *)file->private_data;
|
dev = file->private_data;
|
||||||
|
|
||||||
mutex_lock(&dev->mutex);
|
mutex_lock(&dev->mutex);
|
||||||
/* verify that the device wasn't unplugged */
|
/* verify that the device wasn't unplugged */
|
||||||
@@ -484,7 +484,7 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd,
|
|||||||
int retval;
|
int retval;
|
||||||
int io_res; /* checks for bytes read/written and copy_to/from_user results */
|
int io_res; /* checks for bytes read/written and copy_to/from_user results */
|
||||||
|
|
||||||
dev = (struct iowarrior *)file->private_data;
|
dev = file->private_data;
|
||||||
if (dev == NULL) {
|
if (dev == NULL) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
@@ -657,7 +657,7 @@ static int iowarrior_release(struct inode *inode, struct file *file)
|
|||||||
struct iowarrior *dev;
|
struct iowarrior *dev;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
dev = (struct iowarrior *)file->private_data;
|
dev = file->private_data;
|
||||||
if (dev == NULL) {
|
if (dev == NULL) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
@@ -448,7 +448,7 @@ static int tower_release (struct inode *inode, struct file *file)
|
|||||||
|
|
||||||
dbg(2, "%s: enter", __func__);
|
dbg(2, "%s: enter", __func__);
|
||||||
|
|
||||||
dev = (struct lego_usb_tower *)file->private_data;
|
dev = file->private_data;
|
||||||
|
|
||||||
if (dev == NULL) {
|
if (dev == NULL) {
|
||||||
dbg(1, "%s: object is NULL", __func__);
|
dbg(1, "%s: object is NULL", __func__);
|
||||||
@@ -597,7 +597,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count,
|
|||||||
|
|
||||||
dbg(2, "%s: enter, count = %Zd", __func__, count);
|
dbg(2, "%s: enter, count = %Zd", __func__, count);
|
||||||
|
|
||||||
dev = (struct lego_usb_tower *)file->private_data;
|
dev = file->private_data;
|
||||||
|
|
||||||
/* lock this object */
|
/* lock this object */
|
||||||
if (mutex_lock_interruptible(&dev->lock)) {
|
if (mutex_lock_interruptible(&dev->lock)) {
|
||||||
@@ -686,7 +686,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
|
|||||||
|
|
||||||
dbg(2, "%s: enter, count = %Zd", __func__, count);
|
dbg(2, "%s: enter, count = %Zd", __func__, count);
|
||||||
|
|
||||||
dev = (struct lego_usb_tower *)file->private_data;
|
dev = file->private_data;
|
||||||
|
|
||||||
/* lock this object */
|
/* lock this object */
|
||||||
if (mutex_lock_interruptible(&dev->lock)) {
|
if (mutex_lock_interruptible(&dev->lock)) {
|
||||||
|
@@ -2487,7 +2487,7 @@ sisusb_release(struct inode *inode, struct file *file)
|
|||||||
{
|
{
|
||||||
struct sisusb_usb_data *sisusb;
|
struct sisusb_usb_data *sisusb;
|
||||||
|
|
||||||
if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
|
if (!(sisusb = file->private_data))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
mutex_lock(&sisusb->lock);
|
mutex_lock(&sisusb->lock);
|
||||||
@@ -2519,7 +2519,7 @@ sisusb_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
|
|||||||
u16 buf16;
|
u16 buf16;
|
||||||
u32 buf32, address;
|
u32 buf32, address;
|
||||||
|
|
||||||
if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
|
if (!(sisusb = file->private_data))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
mutex_lock(&sisusb->lock);
|
mutex_lock(&sisusb->lock);
|
||||||
@@ -2661,7 +2661,7 @@ sisusb_write(struct file *file, const char __user *buffer, size_t count,
|
|||||||
u16 buf16;
|
u16 buf16;
|
||||||
u32 buf32, address;
|
u32 buf32, address;
|
||||||
|
|
||||||
if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
|
if (!(sisusb = file->private_data))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
mutex_lock(&sisusb->lock);
|
mutex_lock(&sisusb->lock);
|
||||||
@@ -2804,7 +2804,7 @@ sisusb_lseek(struct file *file, loff_t offset, int orig)
|
|||||||
struct sisusb_usb_data *sisusb;
|
struct sisusb_usb_data *sisusb;
|
||||||
loff_t ret;
|
loff_t ret;
|
||||||
|
|
||||||
if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
|
if (!(sisusb = file->private_data))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
mutex_lock(&sisusb->lock);
|
mutex_lock(&sisusb->lock);
|
||||||
@@ -2969,7 +2969,7 @@ sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||||||
long retval = 0;
|
long retval = 0;
|
||||||
u32 __user *argp = (u32 __user *)arg;
|
u32 __user *argp = (u32 __user *)arg;
|
||||||
|
|
||||||
if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
|
if (!(sisusb = file->private_data))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
mutex_lock(&sisusb->lock);
|
mutex_lock(&sisusb->lock);
|
||||||
|
@@ -116,7 +116,7 @@ static int lcd_release(struct inode *inode, struct file *file)
|
|||||||
{
|
{
|
||||||
struct usb_lcd *dev;
|
struct usb_lcd *dev;
|
||||||
|
|
||||||
dev = (struct usb_lcd *)file->private_data;
|
dev = file->private_data;
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, size_t count, l
|
|||||||
int retval = 0;
|
int retval = 0;
|
||||||
int bytes_read;
|
int bytes_read;
|
||||||
|
|
||||||
dev = (struct usb_lcd *)file->private_data;
|
dev = file->private_data;
|
||||||
|
|
||||||
/* do a blocking bulk read to get data from the device */
|
/* do a blocking bulk read to get data from the device */
|
||||||
retval = usb_bulk_msg(dev->udev,
|
retval = usb_bulk_msg(dev->udev,
|
||||||
@@ -158,7 +158,7 @@ static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||||||
u16 bcdDevice;
|
u16 bcdDevice;
|
||||||
char buf[30];
|
char buf[30];
|
||||||
|
|
||||||
dev = (struct usb_lcd *)file->private_data;
|
dev = file->private_data;
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
|
|||||||
struct urb *urb = NULL;
|
struct urb *urb = NULL;
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
|
|
||||||
dev = (struct usb_lcd *)file->private_data;
|
dev = file->private_data;
|
||||||
|
|
||||||
/* verify that we actually have some data to write */
|
/* verify that we actually have some data to write */
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
|
Reference in New Issue
Block a user