Commit 173f38e5 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: fix up sparse warnings in drivers/usb/misc/*

parent ab8c77a9
......@@ -149,8 +149,8 @@ do { \
/* External data structures / Interface */
typedef struct
{
char *buf; /* return buffer for string contents */
unsigned int bsize; /* size of return buffer */
char __user *buf; /* return buffer for string contents */
unsigned int bsize; /* size of return buffer */
} audevinfo_t,*paudevinfo_t;
/* IO controls */
......@@ -1548,7 +1548,7 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
/* get a string descriptor for the device */
case IOCTL_AU_DEVINFO:
dbg ("IOCTL_AU_DEVINFO");
if (copy_from_user (&devinfo, (void *) arg, sizeof (audevinfo_t))) {
if (copy_from_user (&devinfo, (void __user *) arg, sizeof (audevinfo_t))) {
ret = -EFAULT;
break;
}
......@@ -1578,7 +1578,7 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
}
/* Read data from the device */
static ssize_t auerchar_read (struct file *file, char *buf, size_t count, loff_t * ppos)
static ssize_t auerchar_read (struct file *file, char __user *buf, size_t count, loff_t * ppos)
{
unsigned long flags;
pauerchar_t ccp = (pauerchar_t) file->private_data;
......@@ -1708,7 +1708,7 @@ static ssize_t auerchar_read (struct file *file, char *buf, size_t count, loff_t
/* Write a data block into the right service channel of the device */
static ssize_t auerchar_write (struct file *file, const char *buf, size_t len, loff_t *ppos)
static ssize_t auerchar_write (struct file *file, const char __user *buf, size_t len, loff_t *ppos)
{
pauerchar_t ccp = (pauerchar_t) file->private_data;
pauerswald_t cp = NULL;
......
......@@ -109,9 +109,9 @@ static int brlvger_probe (struct usb_interface *intf,
static void brlvger_disconnect(struct usb_interface *intf);
static int brlvger_open(struct inode *inode, struct file *file);
static int brlvger_release(struct inode *inode, struct file *file);
static ssize_t brlvger_write(struct file *file, const char *buffer,
static ssize_t brlvger_write(struct file *file, const char __user *buffer,
size_t count, loff_t *pos);
static ssize_t brlvger_read(struct file *file, char *buffer,
static ssize_t brlvger_read(struct file *file, char __user *buffer,
size_t count, loff_t *unused_pos);
static int brlvger_ioctl(struct inode *inode, struct file *file,
unsigned cmd, unsigned long arg);
......@@ -546,7 +546,7 @@ brlvger_release(struct inode *inode, struct file *file)
}
static ssize_t
brlvger_write(struct file *file, const char *buffer,
brlvger_write(struct file *file, const char __user *buffer,
size_t count, loff_t *pos)
{
struct brlvger_priv *priv = file->private_data;
......@@ -655,7 +655,7 @@ read_index(struct brlvger_priv *priv)
}
static ssize_t
brlvger_read(struct file *file, char *buffer,
brlvger_read(struct file *file, char __user *buffer,
size_t count, loff_t *unused_pos)
{
struct brlvger_priv *priv = file->private_data;
......@@ -719,7 +719,7 @@ brlvger_ioctl(struct inode *inode, struct file *file,
memcpy(&vi.fwver, priv->fwver, BRLVGER_FWVER_SIZE);
memcpy(&vi.serialnum, priv->serialnum, BRLVGER_SERIAL_SIZE);
if(copy_to_user((void *)arg, &vi, sizeof(vi)))
if(copy_to_user((void __user *)arg, &vi, sizeof(vi)))
return -EFAULT;
return 0;
}
......
......@@ -111,7 +111,7 @@ ioctl_rio(struct inode *inode, struct file *file, unsigned int cmd,
{
struct RioCommand rio_cmd;
struct rio_usb_data *rio = &rio_instance;
void *data;
void __user *data;
unsigned char *buffer;
int result, requesttype;
int retries;
......@@ -129,7 +129,7 @@ ioctl_rio(struct inode *inode, struct file *file, unsigned int cmd,
switch (cmd) {
case RIO_RECV_COMMAND:
data = (void *) arg;
data = (void __user *) arg;
if (data == NULL)
break;
if (copy_from_user(&rio_cmd, data, sizeof(struct RioCommand))) {
......@@ -199,7 +199,7 @@ ioctl_rio(struct inode *inode, struct file *file, unsigned int cmd,
break;
case RIO_SEND_COMMAND:
data = (void *) arg;
data = (void __user *) arg;
if (data == NULL)
break;
if (copy_from_user(&rio_cmd, data, sizeof(struct RioCommand))) {
......@@ -266,7 +266,7 @@ ioctl_rio(struct inode *inode, struct file *file, unsigned int cmd,
}
static ssize_t
write_rio(struct file *file, const char *buffer,
write_rio(struct file *file, const char __user *buffer,
size_t count, loff_t * ppos)
{
struct rio_usb_data *rio = &rio_instance;
......@@ -352,7 +352,7 @@ write_rio(struct file *file, const char *buffer,
}
static ssize_t
read_rio(struct file *file, char *buffer, size_t count, loff_t * ppos)
read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
{
struct rio_usb_data *rio = &rio_instance;
ssize_t read_count;
......
......@@ -32,6 +32,6 @@ struct RioCommand {
int requesttype;
int value;
int index;
void *buffer;
void __user *buffer;
int timeout;
};
......@@ -155,7 +155,7 @@ tiglusb_release (struct inode *inode, struct file *filp)
}
static ssize_t
tiglusb_read (struct file *filp, char *buf, size_t count, loff_t * f_pos)
tiglusb_read (struct file *filp, char __user *buf, size_t count, loff_t * f_pos)
{
ptiglusb_t s = (ptiglusb_t) filp->private_data;
ssize_t ret = 0;
......@@ -208,7 +208,7 @@ tiglusb_read (struct file *filp, char *buf, size_t count, loff_t * f_pos)
}
static ssize_t
tiglusb_write (struct file *filp, const char *buf, size_t count, loff_t * f_pos)
tiglusb_write (struct file *filp, const char __user *buf, size_t count, loff_t * f_pos)
{
ptiglusb_t s = (ptiglusb_t) filp->private_data;
ssize_t ret = 0;
......
......@@ -88,12 +88,12 @@ ioctl_lcd(struct inode *inode, struct file *file, unsigned int cmd,
i = (lcd->lcd_dev)->descriptor.bcdDevice;
sprintf(buf,"%1d%1d.%1d%1d",(i & 0xF000)>>12,(i & 0xF00)>>8,
(i & 0xF0)>>4,(i & 0xF));
if (copy_to_user((void *)arg,buf,strlen(buf))!=0)
if (copy_to_user((void __user *)arg,buf,strlen(buf))!=0)
return -EFAULT;
break;
case IOCTL_GET_DRV_VERSION:
sprintf(buf,DRIVER_VERSION);
if (copy_to_user((void *)arg,buf,strlen(buf))!=0)
if (copy_to_user((void __user *)arg,buf,strlen(buf))!=0)
return -EFAULT;
break;
default:
......@@ -105,7 +105,7 @@ ioctl_lcd(struct inode *inode, struct file *file, unsigned int cmd,
}
static ssize_t
write_lcd(struct file *file, const char *buffer,
write_lcd(struct file *file, const char __user *buffer,
size_t count, loff_t * ppos)
{
struct lcd_usb_data *lcd = &lcd_instance;
......@@ -171,7 +171,7 @@ write_lcd(struct file *file, const char *buffer,
}
static ssize_t
read_lcd(struct file *file, char *buffer, size_t count, loff_t * ppos)
read_lcd(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
{
struct lcd_usb_data *lcd = &lcd_instance;
ssize_t read_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment