@@ -1878,18 +1878,14 @@ static int snd_seq_ioctl_set_client_pool(struct snd_seq_client *client,
/* REMOVE_EVENTS ioctl() */
-static int snd_seq_ioctl_remove_events(struct snd_seq_client *client,
- void __user *arg)
+static int snd_seq_ioctl_remove_events(struct snd_seq_client *client, void *arg)
{
- struct snd_seq_remove_events info;
-
- if (copy_from_user(&info, arg, sizeof(info)))
- return -EFAULT;
+ struct snd_seq_remove_events *info = arg;
/*
* Input mostly not implemented XXX.
*/
- if (info.remove_mode & SNDRV_SEQ_REMOVE_INPUT) {
+ if (info->remove_mode & SNDRV_SEQ_REMOVE_INPUT) {
/*
* No restrictions so for a user client we can clear
* the whole fifo
@@ -1898,8 +1894,8 @@ static int snd_seq_ioctl_remove_events(struct snd_seq_client *client,
snd_seq_fifo_clear(client->data.user.fifo);
}
- if (info.remove_mode & SNDRV_SEQ_REMOVE_OUTPUT)
- snd_seq_queue_remove_cells(client->number, &info);
+ if (info->remove_mode & SNDRV_SEQ_REMOVE_OUTPUT)
+ snd_seq_queue_remove_cells(client->number, info);
return 0;
}
In former commit, actual operations of each ioctl command get argument in kernel space. Copying from/to user space is performed outside of the function. This commit optimizes to the new design. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> --- sound/core/seq/seq_clientmgr.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)