aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2006-12-10 15:21:30 -0500
committerJean Delvare <khali@arrakis.delvare>2006-12-10 15:21:30 -0500
commit2c003e8e1c0c241aec162ba9ec781089c5b2ff3f (patch)
tree612ab73ce5a6810bd3fb459520798b7a62e670d3 /drivers
parent813e30e9ab917f5493147451cfdbf6356a3dcee0 (diff)
i2c: Use put_user instead of copy_to_user where possible
This speeds up the I2C_FUNCS ioctl by 5 to 8% in my tests. Signed-off-by: Jean Delvare <khali@linux-fr.org> Laughed-at-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/i2c-dev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 2e22a2ffa606..d66cefc63df7 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -193,8 +193,7 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file,
193 return 0; 193 return 0;
194 case I2C_FUNCS: 194 case I2C_FUNCS:
195 funcs = i2c_get_functionality(client->adapter); 195 funcs = i2c_get_functionality(client->adapter);
196 return (copy_to_user((unsigned long __user *)arg, &funcs, 196 return put_user(funcs, (unsigned long __user *)arg);
197 sizeof(unsigned long)))?-EFAULT:0;
198 197
199 case I2C_RDWR: 198 case I2C_RDWR:
200 if (copy_from_user(&rdwr_arg, 199 if (copy_from_user(&rdwr_arg,