Commit 144b6300 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: the rest of ieee1394 annotation

parent bdf69a4f
...@@ -1095,7 +1095,7 @@ void stream_free(struct stream *s) ...@@ -1095,7 +1095,7 @@ void stream_free(struct stream *s)
/* File operations */ /* File operations */
static ssize_t amdtp_write(struct file *file, const char *buffer, size_t count, static ssize_t amdtp_write(struct file *file, const char __user *buffer, size_t count,
loff_t *offset_is_ignored) loff_t *offset_is_ignored)
{ {
struct stream *s = file->private_data; struct stream *s = file->private_data;
...@@ -1150,7 +1150,7 @@ static int amdtp_ioctl(struct inode *inode, struct file *file, ...@@ -1150,7 +1150,7 @@ static int amdtp_ioctl(struct inode *inode, struct file *file,
{ {
case AMDTP_IOC_PLUG: case AMDTP_IOC_PLUG:
case AMDTP_IOC_CHANNEL: case AMDTP_IOC_CHANNEL:
if (copy_from_user(&cfg, (struct amdtp_ioctl *) arg, sizeof cfg)) if (copy_from_user(&cfg, (struct amdtp_ioctl __user *) arg, sizeof cfg))
return -EFAULT; return -EFAULT;
else else
return stream_configure(s, cmd, &cfg); return stream_configure(s, cmd, &cfg);
......
...@@ -1333,7 +1333,7 @@ static int dv1394_fasync(int fd, struct file *file, int on) ...@@ -1333,7 +1333,7 @@ static int dv1394_fasync(int fd, struct file *file, int on)
return 0; return 0;
} }
static ssize_t dv1394_write(struct file *file, const char *buffer, size_t count, loff_t *ppos) static ssize_t dv1394_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
{ {
struct video_card *video = file_to_video_card(file); struct video_card *video = file_to_video_card(file);
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
...@@ -1430,7 +1430,7 @@ static ssize_t dv1394_write(struct file *file, const char *buffer, size_t count, ...@@ -1430,7 +1430,7 @@ static ssize_t dv1394_write(struct file *file, const char *buffer, size_t count,
} }
static ssize_t dv1394_read(struct file *file, char *buffer, size_t count, loff_t *ppos) static ssize_t dv1394_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{ {
struct video_card *video = file_to_video_card(file); struct video_card *video = file_to_video_card(file);
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
...@@ -1549,6 +1549,7 @@ static int dv1394_ioctl(struct inode *inode, struct file *file, ...@@ -1549,6 +1549,7 @@ static int dv1394_ioctl(struct inode *inode, struct file *file,
struct video_card *video = file_to_video_card(file); struct video_card *video = file_to_video_card(file);
unsigned long flags; unsigned long flags;
int ret = -EINVAL; int ret = -EINVAL;
void __user *argp = (void __user *)arg;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
...@@ -1718,10 +1719,10 @@ static int dv1394_ioctl(struct inode *inode, struct file *file, ...@@ -1718,10 +1719,10 @@ static int dv1394_ioctl(struct inode *inode, struct file *file,
case DV1394_IOC_INIT: { case DV1394_IOC_INIT: {
struct dv1394_init init; struct dv1394_init init;
if (arg == (unsigned long) NULL) { if (!argp) {
ret = do_dv1394_init_default(video); ret = do_dv1394_init_default(video);
} else { } else {
if (copy_from_user(&init, (void*)arg, sizeof(init))) { if (copy_from_user(&init, argp, sizeof(init))) {
ret = -EFAULT; ret = -EFAULT;
goto out; goto out;
} }
...@@ -1767,7 +1768,7 @@ static int dv1394_ioctl(struct inode *inode, struct file *file, ...@@ -1767,7 +1768,7 @@ static int dv1394_ioctl(struct inode *inode, struct file *file,
spin_unlock_irqrestore(&video->spinlock, flags); spin_unlock_irqrestore(&video->spinlock, flags);
if (copy_to_user((void*)arg, &status, sizeof(status))) { if (copy_to_user(argp, &status, sizeof(status))) {
ret = -EFAULT; ret = -EFAULT;
goto out; goto out;
} }
......
...@@ -705,6 +705,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -705,6 +705,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
struct file_ctx *ctx = (struct file_ctx *)file->private_data; struct file_ctx *ctx = (struct file_ctx *)file->private_data;
struct ti_ohci *ohci = ctx->ohci; struct ti_ohci *ohci = ctx->ohci;
unsigned long flags; unsigned long flags;
void __user *argp = (void __user *)arg;
switch(cmd) switch(cmd)
{ {
...@@ -716,7 +717,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -716,7 +717,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
struct dma_iso_ctx *d; struct dma_iso_ctx *d;
int i; int i;
if (copy_from_user(&v, (void *)arg, sizeof(v))) if (copy_from_user(&v, argp, sizeof(v)))
return -EFAULT; return -EFAULT;
/* if channel < 0, find lowest available one */ /* if channel < 0, find lowest available one */
...@@ -813,7 +814,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -813,7 +814,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
v.channel); v.channel);
} }
if (copy_to_user((void *)arg, &v, sizeof(v))) if (copy_to_user(argp, &v, sizeof(v)))
return -EFAULT; return -EFAULT;
return 0; return 0;
...@@ -825,7 +826,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -825,7 +826,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
u64 mask; u64 mask;
struct dma_iso_ctx *d; struct dma_iso_ctx *d;
if (copy_from_user(&channel, (void *)arg, sizeof(int))) if (copy_from_user(&channel, argp, sizeof(int)))
return -EFAULT; return -EFAULT;
if (channel<0 || channel>(ISO_CHANNELS-1)) { if (channel<0 || channel>(ISO_CHANNELS-1)) {
...@@ -860,7 +861,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -860,7 +861,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
struct video1394_wait v; struct video1394_wait v;
struct dma_iso_ctx *d; struct dma_iso_ctx *d;
if (copy_from_user(&v, (void *)arg, sizeof(v))) if (copy_from_user(&v, argp, sizeof(v)))
return -EFAULT; return -EFAULT;
d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel); d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
...@@ -923,7 +924,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -923,7 +924,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
struct dma_iso_ctx *d; struct dma_iso_ctx *d;
int i; int i;
if (copy_from_user(&v, (void *)arg, sizeof(v))) if (copy_from_user(&v, argp, sizeof(v)))
return -EFAULT; return -EFAULT;
d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel); d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
...@@ -994,7 +995,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -994,7 +995,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
spin_unlock_irqrestore(&d->lock, flags); spin_unlock_irqrestore(&d->lock, flags);
v.buffer=i; v.buffer=i;
if (copy_to_user((void *)arg, &v, sizeof(v))) if (copy_to_user(argp, &v, sizeof(v)))
return -EFAULT; return -EFAULT;
return 0; return 0;
...@@ -1007,7 +1008,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -1007,7 +1008,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
qv.packet_sizes = NULL; qv.packet_sizes = NULL;
if (copy_from_user(&v, (void *)arg, sizeof(v))) if (copy_from_user(&v, argp, sizeof(v)))
return -EFAULT; return -EFAULT;
d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel); d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
...@@ -1023,7 +1024,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -1023,7 +1024,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
unsigned int *psizes; unsigned int *psizes;
int buf_size = d->nb_cmd * sizeof(unsigned int); int buf_size = d->nb_cmd * sizeof(unsigned int);
if (copy_from_user(&qv, (void *)arg, sizeof(qv))) if (copy_from_user(&qv, argp, sizeof(qv)))
return -EFAULT; return -EFAULT;
psizes = kmalloc(buf_size, GFP_KERNEL); psizes = kmalloc(buf_size, GFP_KERNEL);
...@@ -1111,7 +1112,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file, ...@@ -1111,7 +1112,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
struct video1394_wait v; struct video1394_wait v;
struct dma_iso_ctx *d; struct dma_iso_ctx *d;
if (copy_from_user(&v, (void *)arg, sizeof(v))) if (copy_from_user(&v, argp, sizeof(v)))
return -EFAULT; return -EFAULT;
d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel); d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
......
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