aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>2004-06-03 05:37:54 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-03 05:37:54 -0700
commit099a47a26e971e868f2e31f1836a323035d1cde6 (patch)
tree519a747f8b8e42c090a500983440082c4397623c /sound
parent2996867de4d3364faa637d85644b108c9e68d4d7 (diff)
downloadhistory-099a47a26e971e868f2e31f1836a323035d1cde6.tar.gz
[PATCH] sparse: rme9652 annotation
Annotated driver and ioctl structure used by it.
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/rme9652/hdsp.c83
-rw-r--r--sound/pci/rme9652/rme9652.c4
2 files changed, 43 insertions, 44 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 88eb3527297b5a..c91602c1226eb6 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -1250,9 +1250,9 @@ static inline void snd_hdsp_midi_write_byte (hdsp_t *hdsp, int id, int val)
{
/* the hardware already does the relevant bit-mask with 0xff */
if (id) {
- return hdsp_write(hdsp, HDSP_midiDataOut1, val);
+ hdsp_write(hdsp, HDSP_midiDataOut1, val);
} else {
- return hdsp_write(hdsp, HDSP_midiDataOut0, val);
+ hdsp_write(hdsp, HDSP_midiDataOut0, val);
}
}
@@ -3834,7 +3834,7 @@ static char *hdsp_channel_buffer_location(hdsp_t *hdsp,
}
static int snd_hdsp_playback_copy(snd_pcm_substream_t *substream, int channel,
- snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count)
+ snd_pcm_uframes_t pos, void __user *src, snd_pcm_uframes_t count)
{
hdsp_t *hdsp = _snd_pcm_substream_chip(substream);
char *channel_buf;
@@ -3849,7 +3849,7 @@ static int snd_hdsp_playback_copy(snd_pcm_substream_t *substream, int channel,
}
static int snd_hdsp_capture_copy(snd_pcm_substream_t *substream, int channel,
- snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count)
+ snd_pcm_uframes_t pos, void __user *dst, snd_pcm_uframes_t count)
{
hdsp_t *hdsp = _snd_pcm_substream_chip(substream);
char *channel_buf;
@@ -4531,10 +4531,11 @@ static int snd_hdsp_hwdep_dummy_op(snd_hwdep_t *hw, struct file *file)
static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int cmd, unsigned long arg)
{
hdsp_t *hdsp = (hdsp_t *)hw->private_data;
+ void __user *argp = (void __user *)arg;
switch (cmd) {
case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: {
- hdsp_peak_rms_t *peak_rms;
+ hdsp_peak_rms_t __user *peak_rms;
int i;
if (hdsp->io_type == H9652) {
@@ -4542,38 +4543,38 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
int doublespeed = 0;
if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DoubleSpeedStatus)
doublespeed = 1;
- peak_rms = (hdsp_peak_rms_t *)arg;
+ peak_rms = (hdsp_peak_rms_t __user *)arg;
for (i = 0; i < 26; ++i) {
if (!(doublespeed && (i & 4))) {
- if (copy_to_user_fromio((void *)peak_rms->input_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-i*4, 4) != 0)
+ if (copy_to_user_fromio((void __user *)peak_rms->input_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-i*4, 4) != 0)
return -EFAULT;
- if (copy_to_user_fromio((void *)peak_rms->playback_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
+ if (copy_to_user_fromio((void __user *)peak_rms->playback_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
return -EFAULT;
- if (copy_to_user_fromio((void *)peak_rms->output_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-2*(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
+ if (copy_to_user_fromio((void __user *)peak_rms->output_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-2*(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
return -EFAULT;
rms_low = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+i*8) & 0xFFFFFF00;
rms_high = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+i*8+4) & 0xFFFFFF00;
rms_high += (rms_low >> 24);
rms_low <<= 8;
- if (copy_to_user((void *)peak_rms->input_rms+i*8, &rms_low, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->input_rms+i*8, &rms_low, 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->input_rms+i*8+4, &rms_high, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->input_rms+i*8+4, &rms_high, 4) != 0)
return -EFAULT;
rms_low = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+(doublespeed ? 14 : 26)*8+i*8) & 0xFFFFFF00;
rms_high = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+(doublespeed ? 14 : 26)*8+i*8+4) & 0xFFFFFF00;
rms_high += (rms_low >> 24);
rms_low <<= 8;
- if (copy_to_user((void *)peak_rms->playback_rms+i*8, &rms_low, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->playback_rms+i*8, &rms_low, 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->playback_rms+i*8+4, &rms_high, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->playback_rms+i*8+4, &rms_high, 4) != 0)
return -EFAULT;
rms_low = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+2*(doublespeed ? 14 : 26)*8+i*8) & 0xFFFFFF00;
rms_high = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+2*(doublespeed ? 14 : 26)*8+i*8+4) & 0xFFFFFF00;
rms_high += (rms_low >> 24);
rms_low <<= 8;
- if (copy_to_user((void *)peak_rms->output_rms+i*8, &rms_low, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->output_rms+i*8, &rms_low, 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->output_rms+i*8+4, &rms_high, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->output_rms+i*8+4, &rms_high, 4) != 0)
return -EFAULT;
}
}
@@ -4586,25 +4587,25 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DoubleSpeedStatus)
doublespeed = 1;
m = (hdsp_9632_meters_t *)(hdsp->iobase+HDSP_9632_metersBase);
- peak_rms = (hdsp_peak_rms_t *)arg;
+ peak_rms = (hdsp_peak_rms_t __user *)arg;
for (i = 0, j = 0; i < 16; ++i, ++j) {
- if (copy_to_user((void *)peak_rms->input_peaks+i*4, &(m->input_peak[j]), 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->input_peaks+i*4, &(m->input_peak[j]), 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->playback_peaks+i*4, &(m->playback_peak[j]), 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->playback_peaks+i*4, &(m->playback_peak[j]), 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->output_peaks+i*4, &(m->output_peak[j]), 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->output_peaks+i*4, &(m->output_peak[j]), 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->input_rms+i*8, &(m->input_rms_low[j]), 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->input_rms+i*8, &(m->input_rms_low[j]), 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->playback_rms+i*8, &(m->playback_rms_low[j]), 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->playback_rms+i*8, &(m->playback_rms_low[j]), 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->output_rms+i*8, &(m->output_rms_low[j]), 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->output_rms+i*8, &(m->output_rms_low[j]), 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->input_rms+i*8+4, &(m->input_rms_high[j]), 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->input_rms+i*8+4, &(m->input_rms_high[j]), 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->playback_rms+i*8+4, &(m->playback_rms_high[j]), 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->playback_rms+i*8+4, &(m->playback_rms_high[j]), 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->output_rms+i*8+4, &(m->output_rms_high[j]), 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->output_rms+i*8+4, &(m->output_rms_high[j]), 4) != 0)
return -EFAULT;
if (doublespeed && i == 3) i += 4;
}
@@ -4614,25 +4615,25 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
snd_printk("firmware needs to be uploaded to the card.\n");
return -EINVAL;
}
- peak_rms = (hdsp_peak_rms_t *)arg;
+ peak_rms = (hdsp_peak_rms_t __user *)arg;
for (i = 0; i < 26; ++i) {
- if (copy_to_user((void *)peak_rms->playback_peaks+i*4, (void *)hdsp->iobase+HDSP_playbackPeakLevel+i*4, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->playback_peaks+i*4, (void *)hdsp->iobase+HDSP_playbackPeakLevel+i*4, 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->input_peaks+i*4, (void *)hdsp->iobase+HDSP_inputPeakLevel+i*4, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->input_peaks+i*4, (void *)hdsp->iobase+HDSP_inputPeakLevel+i*4, 4) != 0)
return -EFAULT;
}
for (i = 0; i < 26; ++i) {
- if (copy_to_user((void *)peak_rms->playback_rms+i*8+4, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->playback_rms+i*8+4, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8, 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->playback_rms+i*8, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8+4, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->playback_rms+i*8, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8+4, 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->input_rms+i*8+4, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->input_rms+i*8+4, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8, 4) != 0)
return -EFAULT;
- if (copy_to_user((void *)peak_rms->input_rms+i*8, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8+4, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->input_rms+i*8, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8+4, 4) != 0)
return -EFAULT;
}
for (i = 0; i < 28; ++i) {
- if (copy_to_user((void *)peak_rms->output_peaks+i*4, (void *)hdsp->iobase+HDSP_outputPeakLevel+i*4, 4) != 0)
+ if (copy_to_user((void __user *)peak_rms->output_peaks+i*4, (void *)hdsp->iobase+HDSP_outputPeakLevel+i*4, 4) != 0)
return -EFAULT;
}
break;
@@ -4680,7 +4681,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
info.analog_extension_board = (unsigned char)hdsp_aeb(hdsp);
}
spin_unlock_irqrestore(&hdsp->lock, flags);
- if (copy_to_user((void *)arg, &info, sizeof(info)))
+ if (copy_to_user(argp, &info, sizeof(info)))
return -EFAULT;
break;
}
@@ -4690,7 +4691,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
if (hdsp->io_type != H9632) return -EINVAL;
h9632_aeb.aebi = hdsp->ss_in_channels - H9632_SS_CHANNELS;
h9632_aeb.aebo = hdsp->ss_out_channels - H9632_SS_CHANNELS;
- if (copy_to_user((void *)arg, &h9632_aeb, sizeof(h9632_aeb)))
+ if (copy_to_user(argp, &h9632_aeb, sizeof(h9632_aeb)))
return -EFAULT;
break;
}
@@ -4706,14 +4707,14 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
}
hdsp_version.io_type = hdsp->io_type;
hdsp_version.firmware_rev = hdsp->firmware_rev;
- if ((err = copy_to_user((void *)arg, &hdsp_version, sizeof(hdsp_version)))) {
+ if ((err = copy_to_user(argp, &hdsp_version, sizeof(hdsp_version)))) {
return -EFAULT;
}
break;
}
case SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE: {
- hdsp_firmware_t *firmware;
- unsigned long *firmware_data;
+ hdsp_firmware_t __user *firmware;
+ unsigned long __user *firmware_data;
int err;
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL;
@@ -4721,7 +4722,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
if (hdsp->io_type == Undefined) return -EINVAL;
snd_printk("initializing firmware upload\n");
- firmware = (hdsp_firmware_t *)arg;
+ firmware = (hdsp_firmware_t __user *)argp;
if (get_user(firmware_data, &firmware->firmware_data)) {
return -EFAULT;
@@ -4754,9 +4755,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
break;
}
case SNDRV_HDSP_IOCTL_GET_MIXER: {
- hdsp_mixer_t *mixer;
-
- mixer = (hdsp_mixer_t *)arg;
+ hdsp_mixer_t __user *mixer = (hdsp_mixer_t __user *)argp;
if (copy_to_user(mixer->matrix, hdsp->mixer_matrix, sizeof(unsigned short)*HDSP_MATRIX_MIXER_SIZE))
return -EFAULT;
break;
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 155d72a7371a2f..e1abd98134c5b5 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -2011,7 +2011,7 @@ static char *rme9652_channel_buffer_location(rme9652_t *rme9652,
}
static int snd_rme9652_playback_copy(snd_pcm_substream_t *substream, int channel,
- snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count)
+ snd_pcm_uframes_t pos, void __user *src, snd_pcm_uframes_t count)
{
rme9652_t *rme9652 = _snd_pcm_substream_chip(substream);
char *channel_buf;
@@ -2028,7 +2028,7 @@ static int snd_rme9652_playback_copy(snd_pcm_substream_t *substream, int channel
}
static int snd_rme9652_capture_copy(snd_pcm_substream_t *substream, int channel,
- snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count)
+ snd_pcm_uframes_t pos, void __user *dst, snd_pcm_uframes_t count)
{
rme9652_t *rme9652 = _snd_pcm_substream_chip(substream);
char *channel_buf;