[PATCH 09/27] ALSA: seq: optimize client_id function to new design

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 sound/core/seq/seq_clientmgr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 439e2df6..9cf5a82 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1122,9 +1122,12 @@ static int seq_ioctl_pversion(struct snd_seq_client *client, void *arg)
 	return 0;
 }
 
-static int seq_ioctl_client_id(struct snd_seq_client *client, void __user *arg)
+static int seq_ioctl_client_id(struct snd_seq_client *client, void *arg)
 {
-	return put_user(client->number, (int __user *)arg) ? -EFAULT : 0;
+	int *number = arg;
+
+	*number = client->number;
+	return 0;
 }
 
 /* SYSTEM_INFO ioctl() */
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux