Commit e3b784cf authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: opl annatation

Annotated sound/drivers/opl*
parent 5851bd06
...@@ -94,6 +94,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file, ...@@ -94,6 +94,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
opl3_t *opl3 = snd_magic_cast(opl3_t, hw->private_data, return -ENXIO); opl3_t *opl3 = snd_magic_cast(opl3_t, hw->private_data, return -ENXIO);
void __user *argp = (void __user *)arg;
snd_assert(opl3 != NULL, return -EINVAL); snd_assert(opl3 != NULL, return -EINVAL);
...@@ -105,7 +106,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file, ...@@ -105,7 +106,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
info.fm_mode = opl3->fm_mode; info.fm_mode = opl3->fm_mode;
info.rhythm = opl3->rhythm; info.rhythm = opl3->rhythm;
if (copy_to_user((snd_dm_fm_info_t *) arg, &info, sizeof(snd_dm_fm_info_t))) if (copy_to_user(argp, &info, sizeof(snd_dm_fm_info_t)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -123,7 +124,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file, ...@@ -123,7 +124,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
#endif #endif
{ {
snd_dm_fm_note_t note; snd_dm_fm_note_t note;
if (copy_from_user(&note, (snd_dm_fm_note_t *) arg, sizeof(snd_dm_fm_note_t))) if (copy_from_user(&note, argp, sizeof(snd_dm_fm_note_t)))
return -EFAULT; return -EFAULT;
return snd_opl3_play_note(opl3, &note); return snd_opl3_play_note(opl3, &note);
} }
...@@ -134,7 +135,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file, ...@@ -134,7 +135,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
#endif #endif
{ {
snd_dm_fm_voice_t voice; snd_dm_fm_voice_t voice;
if (copy_from_user(&voice, (snd_dm_fm_voice_t *) arg, sizeof(snd_dm_fm_voice_t))) if (copy_from_user(&voice, argp, sizeof(snd_dm_fm_voice_t)))
return -EFAULT; return -EFAULT;
return snd_opl3_set_voice(opl3, &voice); return snd_opl3_set_voice(opl3, &voice);
} }
...@@ -145,7 +146,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file, ...@@ -145,7 +146,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
#endif #endif
{ {
snd_dm_fm_params_t params; snd_dm_fm_params_t params;
if (copy_from_user(&params, (snd_dm_fm_params_t *) arg, sizeof(snd_dm_fm_params_t))) if (copy_from_user(&params, argp, sizeof(snd_dm_fm_params_t)))
return -EFAULT; return -EFAULT;
return snd_opl3_set_params(opl3, &params); return snd_opl3_set_params(opl3, &params);
} }
......
...@@ -50,7 +50,7 @@ static int snd_opl4_mem_proc_release(snd_info_entry_t *entry, ...@@ -50,7 +50,7 @@ static int snd_opl4_mem_proc_release(snd_info_entry_t *entry,
} }
static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_data, static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_data,
struct file *file, char *_buf, long count) struct file *file, char __user *_buf, long count)
{ {
opl4_t *opl4 = snd_magic_cast(opl4_t, entry->private_data, return -ENXIO); opl4_t *opl4 = snd_magic_cast(opl4_t, entry->private_data, return -ENXIO);
long size; long size;
...@@ -76,7 +76,7 @@ static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_d ...@@ -76,7 +76,7 @@ static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_d
} }
static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_data, static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_data,
struct file *file, const char *_buf, long count) struct file *file, const char __user *_buf, long count)
{ {
opl4_t *opl4 = snd_magic_cast(opl4_t, entry->private_data, return -ENXIO); opl4_t *opl4 = snd_magic_cast(opl4_t, entry->private_data, return -ENXIO);
long size; long size;
......
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