X-Git-Url: http://git.onelab.eu/?p=linux-2.6.git;a=blobdiff_plain;f=sound%2Foss%2Fad1889.c;h=89543f3a36e412adaa65a694f42e43ba12e57839;hp=98515fee59b8e45104f4417298c4a09415be1868;hb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;hpb=c449269f45c2cdf53af08c8d0af37472f66539d9 diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c index 98515fee5..89543f3a3 100644 --- a/sound/oss/ad1889.c +++ b/sound/oss/ad1889.c @@ -437,13 +437,13 @@ XXX /************************* /dev/dsp interfaces ************************* */ -static ssize_t ad1889_read(struct file *file, char *buffer, size_t count, +static ssize_t ad1889_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) { return 0; } -static ssize_t ad1889_write(struct file *file, const char *buffer, size_t count, +static ssize_t ad1889_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data; @@ -617,11 +617,12 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data; struct dmabuf *dmabuf; audio_buf_info abinfo; + int __user *p = (int __user *)arg; switch (cmd) { case OSS_GETVERSION: - return put_user(SOUND_VERSION, (int *)arg); + return put_user(SOUND_VERSION, p); case SNDCTL_DSP_RESET: break; @@ -631,7 +632,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_SPEED: /* set sampling rate */ - if (get_user(val, (int *)arg)) + if (get_user(val, p)) return -EFAULT; if (val > 5400 && val < 48000) { @@ -643,7 +644,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd return 0; case SNDCTL_DSP_STEREO: /* undocumented? */ - if (get_user(val, (int *)arg)) + if (get_user(val, p)) return -EFAULT; if (file->f_mode & FMODE_READ) { val = AD1889_READW(ad1889_dev, AD_DSWSMC); @@ -667,13 +668,13 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd return 0; case SNDCTL_DSP_GETBLKSIZE: - return put_user(DMA_SIZE, (int *)arg); + return put_user(DMA_SIZE, p); case SNDCTL_DSP_GETFMTS: - return put_user(AFMT_S16_LE|AFMT_U8, (int *)arg); + return put_user(AFMT_S16_LE|AFMT_U8, p); case SNDCTL_DSP_SETFMT: - if (get_user(val, (int *)arg)) + if (get_user(val, p)) return -EFAULT; if (file->f_mode & FMODE_READ) @@ -682,7 +683,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd if (file->f_mode & FMODE_WRITE) ad1889_set_wav_fmt(dev, val); - return put_user(val, (int *)arg); + return put_user(val, p); case SNDCTL_DSP_CHANNELS: break; @@ -696,7 +697,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd case SNDCTL_DSP_SETFRAGMENT: /* not supported; uses fixed fragment sizes */ - return put_user(DMA_SIZE, (int *)arg); + return put_user(DMA_SIZE, p); case SNDCTL_DSP_GETOSPACE: case SNDCTL_DSP_GETISPACE: @@ -709,13 +710,13 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd abinfo.fragstotal = 1; abinfo.fragsize = DMA_SIZE; abinfo.bytes = DMA_SIZE; - return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; + return copy_to_user(p, &abinfo, sizeof(abinfo)) ? -EFAULT : 0; case SNDCTL_DSP_NONBLOCK: file->f_flags |= O_NONBLOCK; return 0; case SNDCTL_DSP_GETCAPS: - return put_user(0, (int *)arg); + return put_user(0, p); case SNDCTL_DSP_GETTRIGGER: case SNDCTL_DSP_SETTRIGGER: @@ -732,7 +733,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd break; case SOUND_PCM_READ_RATE: - return put_user(AD1889_READW(ad1889_dev, AD_DSWAS), (int *)arg); + return put_user(AD1889_READW(ad1889_dev, AD_DSWAS), p); case SOUND_PCM_READ_CHANNELS: case SOUND_PCM_READ_BITS: