Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c-dev: Fix typo in ioctl name reference

The ioctl is named I2C_RDWR for "I2C read/write". But references to it
were misspelled "rdrw". Fix them.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Jean Delvare and committed by
Wolfram Sang
c57d3e7a d64d45cb

+7 -5
+3 -3
drivers/i2c/i2c-dev.c
··· 235 235 return result; 236 236 } 237 237 238 - static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client, 238 + static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client, 239 239 unsigned long arg) 240 240 { 241 241 struct i2c_rdwr_ioctl_data rdwr_arg; ··· 250 250 251 251 /* Put an arbitrary limit on the number of messages that can 252 252 * be sent at once */ 253 - if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS) 253 + if (rdwr_arg.nmsgs > I2C_RDWR_IOCTL_MAX_MSGS) 254 254 return -EINVAL; 255 255 256 256 rdwr_pa = memdup_user(rdwr_arg.msgs, ··· 456 456 return put_user(funcs, (unsigned long __user *)arg); 457 457 458 458 case I2C_RDWR: 459 - return i2cdev_ioctl_rdrw(client, arg); 459 + return i2cdev_ioctl_rdwr(client, arg); 460 460 461 461 case I2C_SMBUS: 462 462 return i2cdev_ioctl_smbus(client, arg);
+1 -1
fs/compat_ioctl.c
··· 686 686 687 687 if (get_user(nmsgs, &udata->nmsgs)) 688 688 return -EFAULT; 689 - if (nmsgs > I2C_RDRW_IOCTL_MAX_MSGS) 689 + if (nmsgs > I2C_RDWR_IOCTL_MAX_MSGS) 690 690 return -EINVAL; 691 691 692 692 if (get_user(datap, &udata->msgs))
+3 -1
include/uapi/linux/i2c-dev.h
··· 66 66 __u32 nmsgs; /* number of i2c_msgs */ 67 67 }; 68 68 69 - #define I2C_RDRW_IOCTL_MAX_MSGS 42 69 + #define I2C_RDWR_IOCTL_MAX_MSGS 42 70 + /* Originally defined with a typo, keep it for compatibility */ 71 + #define I2C_RDRW_IOCTL_MAX_MSGS I2C_RDWR_IOCTL_MAX_MSGS 70 72 71 73 72 74 #endif /* _UAPI_LINUX_I2C_DEV_H */