Commit:     2c003e8e1c0c241aec162ba9ec781089c5b2ff3f
Parent:     813e30e9ab917f5493147451cfdbf6356a3dcee0
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sun Dec 10 21:21:30 2006 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Dec 10 21:21:30 2006 +0100

    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 <[EMAIL PROTECTED]>
    Laughed-at-by: Mark M. Hoffman <[EMAIL PROTECTED]>
 drivers/i2c/i2c-dev.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 2e22a2f..d66cefc 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 
                return 0;
        case I2C_FUNCS:
                funcs = i2c_get_functionality(client->adapter);
-               return (copy_to_user((unsigned long __user *)arg, &funcs,
-                                    sizeof(unsigned long)))?-EFAULT:0;
+               return put_user(funcs, (unsigned long __user *)arg);
        case I2C_RDWR:
                if (copy_from_user(&rdwr_arg, 
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to