diff mbox

[09/39] ALSA: seq: optimize pversion function to new design

Message ID 1470563355-18368-10-git-send-email-o-takashi@sakamocchi.jp (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Sakamoto Aug. 7, 2016, 9:48 a.m. UTC
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 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index a643b4e..5e81d4f 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1114,9 +1114,12 @@  static unsigned int snd_seq_poll(struct file *file, poll_table * wait)
 /*-----------------------------------------------------*/
 
 
-static int seq_ioctl_pversion(struct snd_seq_client *client, void __user *arg)
+static int seq_ioctl_pversion(struct snd_seq_client *client, void *arg)
 {
-	return put_user(SNDRV_SEQ_VERSION, (int __user *)arg) ? -EFAULT : 0;
+	int *version = arg;
+
+	*version = SNDRV_SEQ_VERSION;
+	return 0;
 }
 
 static int seq_ioctl_client_id(struct snd_seq_client *client, void __user *arg)