ChangeSet 1.1318.4.12, 2003/06/17 14:52:45-07:00, greg@kroah.com [PATCH] USB: fix up sparse warnings in drivers/usb/class/* drivers/usb/class/audio.c | 28 ++++++++++++++-------------- drivers/usb/class/bluetty.c | 2 +- drivers/usb/class/cdc-acm.c | 2 +- drivers/usb/class/usb-midi.c | 4 ++-- drivers/usb/class/usblp.c | 14 +++++++------- 5 files changed, 25 insertions(+), 25 deletions(-) diff -Nru a/drivers/usb/class/audio.c b/drivers/usb/class/audio.c --- a/drivers/usb/class/audio.c Wed Jun 18 11:14:44 2003 +++ b/drivers/usb/class/audio.c Wed Jun 18 11:14:44 2003 @@ -541,7 +541,7 @@ pgrem = rem; memcpy((db->sgbuf[db->wrptr >> PAGE_SHIFT]) + (db->wrptr & (PAGE_SIZE-1)), buffer, pgrem); size -= pgrem; - (char *)buffer += pgrem; + buffer += pgrem; db->wrptr += pgrem; if (db->wrptr >= db->dmasize) db->wrptr = 0; @@ -564,14 +564,14 @@ pgrem = rem; memcpy(buffer, (db->sgbuf[db->rdptr >> PAGE_SHIFT]) + (db->rdptr & (PAGE_SIZE-1)), pgrem); size -= pgrem; - (char *)buffer += pgrem; + buffer += pgrem; db->rdptr += pgrem; if (db->rdptr >= db->dmasize) db->rdptr = 0; } } -static int dmabuf_copyin_user(struct dmabuf *db, unsigned int ptr, const void *buffer, unsigned int size) +static int dmabuf_copyin_user(struct dmabuf *db, unsigned int ptr, const void __user *buffer, unsigned int size) { unsigned int pgrem, rem; @@ -589,14 +589,14 @@ if (copy_from_user((db->sgbuf[ptr >> PAGE_SHIFT]) + (ptr & (PAGE_SIZE-1)), buffer, pgrem)) return -EFAULT; size -= pgrem; - (char *)buffer += pgrem; + buffer += pgrem; ptr += pgrem; if (ptr >= db->dmasize) ptr = 0; } } -static int dmabuf_copyout_user(struct dmabuf *db, unsigned int ptr, void *buffer, unsigned int size) +static int dmabuf_copyout_user(struct dmabuf *db, unsigned int ptr, void __user *buffer, unsigned int size) { unsigned int pgrem, rem; @@ -614,7 +614,7 @@ if (copy_to_user(buffer, (db->sgbuf[ptr >> PAGE_SHIFT]) + (ptr & (PAGE_SIZE-1)), pgrem)) return -EFAULT; size -= pgrem; - (char *)buffer += pgrem; + buffer += pgrem; ptr += pgrem; if (ptr >= db->dmasize) ptr = 0; @@ -2010,7 +2010,7 @@ strncpy(info.id, "USB_AUDIO", sizeof(info.id)); strncpy(info.name, "USB Audio Class Driver", sizeof(info.name)); info.modify_counter = ms->modcnt; - if (copy_to_user((void *)arg, &info, sizeof(info))) + if (copy_to_user((void __user *)arg, &info, sizeof(info))) return -EFAULT; return 0; } @@ -2018,7 +2018,7 @@ _old_mixer_info info; strncpy(info.id, "USB_AUDIO", sizeof(info.id)); strncpy(info.name, "USB Audio Class Driver", sizeof(info.name)); - if (copy_to_user((void *)arg, &info, sizeof(info))) + if (copy_to_user((void __user *)arg, &info, sizeof(info))) return -EFAULT; return 0; } @@ -2140,7 +2140,7 @@ /* --------------------------------------------------------------------- */ -static ssize_t usb_audio_read(struct file *file, char *buffer, size_t count, loff_t *ppos) +static ssize_t usb_audio_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) { struct usb_audiodev *as = (struct usb_audiodev *)file->private_data; DECLARE_WAITQUEUE(wait, current); @@ -2208,7 +2208,7 @@ return ret; } -static ssize_t usb_audio_write(struct file *file, const char *buffer, size_t count, loff_t *ppos) +static ssize_t usb_audio_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { struct usb_audiodev *as = (struct usb_audiodev *)file->private_data; DECLARE_WAITQUEUE(wait, current); @@ -2507,7 +2507,7 @@ abinfo.fragstotal = as->usbout.dma.numfrag; abinfo.fragments = abinfo.bytes >> as->usbout.dma.fragshift; spin_unlock_irqrestore(&as->lock, flags); - return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; + return copy_to_user((void __user *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; case SNDCTL_DSP_GETISPACE: if (!(file->f_mode & FMODE_READ)) @@ -2520,7 +2520,7 @@ abinfo.fragstotal = as->usbin.dma.numfrag; abinfo.fragments = abinfo.bytes >> as->usbin.dma.fragshift; spin_unlock_irqrestore(&as->lock, flags); - return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; + return copy_to_user((void __user *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; case SNDCTL_DSP_NONBLOCK: file->f_flags |= O_NONBLOCK; @@ -2544,7 +2544,7 @@ if (as->usbin.dma.mapped) as->usbin.dma.count &= as->usbin.dma.fragsize-1; spin_unlock_irqrestore(&as->lock, flags); - if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo))) + if (copy_to_user((void __user *)arg, &cinfo, sizeof(cinfo))) return -EFAULT; return 0; @@ -2558,7 +2558,7 @@ if (as->usbout.dma.mapped) as->usbout.dma.count &= as->usbout.dma.fragsize-1; spin_unlock_irqrestore(&as->lock, flags); - if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo))) + if (copy_to_user((void __user *)arg, &cinfo, sizeof(cinfo))) return -EFAULT; return 0; diff -Nru a/drivers/usb/class/bluetty.c b/drivers/usb/class/bluetty.c --- a/drivers/usb/class/bluetty.c Wed Jun 18 11:14:44 2003 +++ b/drivers/usb/class/bluetty.c Wed Jun 18 11:14:44 2003 @@ -484,7 +484,7 @@ retval = -ENOMEM; goto exit; } - if (copy_from_user (temp_buffer, buf, count)) { + if (copy_from_user (temp_buffer, (void __user *)buf, count)) { retval = -EFAULT; goto exit; } diff -Nru a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c --- a/drivers/usb/class/cdc-acm.c Wed Jun 18 11:14:44 2003 +++ b/drivers/usb/class/cdc-acm.c Wed Jun 18 11:14:44 2003 @@ -388,7 +388,7 @@ count = (count > acm->writesize) ? acm->writesize : count; if (from_user) { - if (copy_from_user(acm->writeurb->transfer_buffer, buf, count)) + if (copy_from_user(acm->writeurb->transfer_buffer, (void __user *)buf, count)) return -EFAULT; } else memcpy(acm->writeurb->transfer_buffer, buf, count); diff -Nru a/drivers/usb/class/usb-midi.c b/drivers/usb/class/usb-midi.c --- a/drivers/usb/class/usb-midi.c Wed Jun 18 11:14:44 2003 +++ b/drivers/usb/class/usb-midi.c Wed Jun 18 11:14:44 2003 @@ -642,7 +642,7 @@ * **/ -static ssize_t usb_midi_read(struct file *file, char *buffer, size_t count, loff_t *ppos) +static ssize_t usb_midi_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) { struct usb_mididev *m = (struct usb_mididev *)file->private_data; struct midi_in_endpoint *ep = m->min.ep; @@ -725,7 +725,7 @@ * **/ -static ssize_t usb_midi_write(struct file *file, const char *buffer, size_t count, loff_t *ppos) +static ssize_t usb_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { struct usb_mididev *m = (struct usb_mididev *)file->private_data; ssize_t ret; diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c --- a/drivers/usb/class/usblp.c Wed Jun 18 11:14:44 2003 +++ b/drivers/usb/class/usblp.c Wed Jun 18 11:14:44 2003 @@ -455,7 +455,7 @@ if (length > _IOC_SIZE(cmd)) length = _IOC_SIZE(cmd); /* truncate */ - if (copy_to_user((unsigned char *) arg, + if (copy_to_user((void __user *) arg, usblp->device_id_string, (unsigned long) length)) { retval = -EFAULT; @@ -479,7 +479,7 @@ twoints[1] |= (1<dev->bus->busnum; twoints[1] = usblp->dev->devnum; - if (copy_to_user((unsigned char *)arg, + if (copy_to_user((void __user *)arg, (unsigned char *)twoints, sizeof(twoints))) { retval = -EFAULT; @@ -560,7 +560,7 @@ twoints[0] = usblp->dev->descriptor.idVendor; twoints[1] = usblp->dev->descriptor.idProduct; - if (copy_to_user((unsigned char *)arg, + if (copy_to_user((void __user *)arg, (unsigned char *)twoints, sizeof(twoints))) { retval = -EFAULT; @@ -584,7 +584,7 @@ goto done; } status = *usblp->statusbuf; - if (copy_to_user ((int *)arg, &status, sizeof(int))) + if (copy_to_user ((void __user *)arg, &status, sizeof(int))) retval = -EFAULT; break; @@ -597,7 +597,7 @@ return retval; } -static ssize_t usblp_write(struct file *file, const char *buffer, size_t count, loff_t *ppos) +static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { DECLARE_WAITQUEUE(wait, current); struct usblp *usblp = file->private_data; @@ -682,7 +682,7 @@ return count; } -static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t *ppos) +static ssize_t usblp_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) { struct usblp *usblp = file->private_data; DECLARE_WAITQUEUE(wait, current);