aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2004-06-03 05:41:21 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-03 05:41:21 -0700
commita500bcb79f7cfef9f65765dbe9550d69c7151d71 (patch)
tree6a795724920a3bf66a3f60843fcf1d7df6dda1ad /sound
parenta83d576c4ceb98596debf571d7686533a8e73f57 (diff)
downloadhistory-a500bcb79f7cfef9f65765dbe9550d69c7151d71.tar.gz
[PATCH] sparse: msnd annotation
msnd annotated
Diffstat (limited to 'sound')
-rw-r--r--sound/oss/msnd_pinnacle.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
index 16a918fb442c9d..a130ba4c05e33f 100644
--- a/sound/oss/msnd_pinnacle.c
+++ b/sound/oss/msnd_pinnacle.c
@@ -212,6 +212,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
LPDAQD lpDAQ, lpDARQ;
audio_buf_info abinfo;
unsigned long flags;
+ int __user *p = (int __user *)arg;
lpDAQ = dev.base + DAPQ_DATA_BUFF;
lpDARQ = dev.base + DARQ_DATA_BUFF;
@@ -238,7 +239,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
abinfo.fragstotal = dev.DAPF.n / abinfo.fragsize;
abinfo.fragments = abinfo.bytes / abinfo.fragsize;
spin_unlock_irqrestore(&dev.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))
@@ -249,7 +250,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
abinfo.fragstotal = dev.DARF.n / abinfo.fragsize;
abinfo.fragments = abinfo.bytes / abinfo.fragsize;
spin_unlock_irqrestore(&dev.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_RESET:
dev.nresets = 0;
@@ -262,18 +263,18 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case SNDCTL_DSP_GETBLKSIZE:
tmp = dsp_get_frag_size();
- if (put_user(tmp, (int *)arg))
+ if (put_user(tmp, p))
return -EFAULT;
return 0;
case SNDCTL_DSP_GETFMTS:
val = AFMT_S16_LE | AFMT_U8;
- if (put_user(val, (int *)arg))
+ if (put_user(val, p))
return -EFAULT;
return 0;
case SNDCTL_DSP_SETFMT:
- if (get_user(val, (int *)arg))
+ if (get_user(val, p))
return -EFAULT;
if (file->f_mode & FMODE_WRITE)
@@ -285,7 +286,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
? dev.rec_sample_size
: dsp_set_format(file, val);
- if (put_user(data, (int *)arg))
+ if (put_user(data, p))
return -EFAULT;
return 0;
@@ -299,12 +300,12 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case SNDCTL_DSP_GETCAPS:
val = DSP_CAP_DUPLEX | DSP_CAP_BATCH;
- if (put_user(val, (int *)arg))
+ if (put_user(val, p))
return -EFAULT;
return 0;
case SNDCTL_DSP_SPEED:
- if (get_user(val, (int *)arg))
+ if (get_user(val, p))
return -EFAULT;
if (val < 8000)
@@ -326,13 +327,13 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (file->f_mode & FMODE_READ)
dev.rec_sample_rate = data;
- if (put_user(data, (int *)arg))
+ if (put_user(data, p))
return -EFAULT;
return 0;
case SNDCTL_DSP_CHANNELS:
case SNDCTL_DSP_STEREO:
- if (get_user(val, (int *)arg))
+ if (get_user(val, p))
return -EFAULT;
if (cmd == SNDCTL_DSP_CHANNELS) {
@@ -369,7 +370,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (file->f_mode & FMODE_READ)
dev.rec_channels = data;
- if (put_user(val, (int *)arg))
+ if (put_user(val, p))
return -EFAULT;
return 0;
}
@@ -565,13 +566,13 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
mixer_info info;
set_mixer_info();
info.modify_counter = dev.mixer_mod_count;
- if (copy_to_user((void *)arg, &info, sizeof(info)))
+ if (copy_to_user((void __user *)arg, &info, sizeof(info)))
return -EFAULT;
return 0;
} else if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info;
set_mixer_info();
- if (copy_to_user((void *)arg, &info, sizeof(info)))
+ if (copy_to_user((void __user *)arg, &info, sizeof(info)))
return -EFAULT;
return 0;
} else if (cmd == SOUND_MIXER_PRIVATE1) {
@@ -584,19 +585,19 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
switch (cmd & 0xff) {
case SOUND_MIXER_RECSRC:
- if (get_user(val, (int *)arg))
+ if (get_user(val, (int __user *)arg))
return -EFAULT;
val = set_recsrc(val);
break;
default:
- if (get_user(val, (int *)arg))
+ if (get_user(val, (int __user *)arg))
return -EFAULT;
val = mixer_set(cmd & 0xff, val);
break;
}
++dev.mixer_mod_count;
- return put_user(val, (int *)arg);
+ return put_user(val, (int __user *)arg);
} else {
switch (cmd & 0xff) {
case SOUND_MIXER_RECSRC:
@@ -638,7 +639,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
}
}
- return put_user(val, (int *)arg);
+ return put_user(val, (int __user *)arg);
}
return -EINVAL;
@@ -650,7 +651,7 @@ static int dev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
if (cmd == OSS_GETVERSION) {
int sound_version = SOUND_VERSION;
- return put_user(sound_version, (int *)arg);
+ return put_user(sound_version, (int __user *)arg);
}
if (minor == dev.dsp_minor)
@@ -888,7 +889,7 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start)
return nbanks;
}
-static int dsp_read(char *buf, size_t len)
+static int dsp_read(char __user *buf, size_t len)
{
int count = len;
char *page = (char *)__get_free_page(PAGE_SIZE);
@@ -946,7 +947,7 @@ static int dsp_read(char *buf, size_t len)
return len - count;
}
-static int dsp_write(const char *buf, size_t len)
+static int dsp_write(const char __user *buf, size_t len)
{
int count = len;
char *page = (char *)__get_free_page(GFP_KERNEL);
@@ -1005,7 +1006,7 @@ static int dsp_write(const char *buf, size_t len)
return len - count;
}
-static ssize_t dev_read(struct file *file, char *buf, size_t count, loff_t *off)
+static ssize_t dev_read(struct file *file, char __user *buf, size_t count, loff_t *off)
{
int minor = iminor(file->f_dentry->d_inode);
if (minor == dev.dsp_minor)
@@ -1014,7 +1015,7 @@ static ssize_t dev_read(struct file *file, char *buf, size_t count, loff_t *off)
return -EINVAL;
}
-static ssize_t dev_write(struct file *file, const char *buf, size_t count, loff_t *off)
+static ssize_t dev_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
{
int minor = iminor(file->f_dentry->d_inode);
if (minor == dev.dsp_minor)