diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2011-10-06 02:41:06 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-10-11 17:48:36 -0300 |
commit | 06bd801c23939952bc6e1cf65f0e8c0fff09d2d7 (patch) | |
tree | 7a42a82e6a8eb6bf2a5f40d4ef36fe613024cea8 /drivers/media/rc/ir-lirc-codec.c | |
parent | e30528854797f057aa6ffb6dc9f890e923c467fd (diff) | |
download | op-kernel-dev-06bd801c23939952bc6e1cf65f0e8c0fff09d2d7.zip op-kernel-dev-06bd801c23939952bc6e1cf65f0e8c0fff09d2d7.tar.gz |
[media] rc/ir-lirc-codec: cleanup __user tags
The code here treated user pointers correctly, but the __user tags
weren't used correctly so it caused Sparse warnings:
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/ir-lirc-codec.c')
-rw-r--r-- | drivers/media/rc/ir-lirc-codec.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c index e5eeec4..ec2e67f 100644 --- a/drivers/media/rc/ir-lirc-codec.c +++ b/drivers/media/rc/ir-lirc-codec.c @@ -98,7 +98,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev) return 0; } -static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf, +static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf, size_t n, loff_t *ppos) { struct lirc_codec *lirc; @@ -140,10 +140,11 @@ out: } static long ir_lirc_ioctl(struct file *filep, unsigned int cmd, - unsigned long __user arg) + unsigned long arg) { struct lirc_codec *lirc; struct rc_dev *dev; + u32 __user *argp = (u32 __user *)(arg); int ret = 0; __u32 val = 0, tmp; @@ -156,7 +157,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd, return -EFAULT; if (_IOC_DIR(cmd) & _IOC_WRITE) { - ret = get_user(val, (__u32 *)arg); + ret = get_user(val, argp); if (ret) return ret; } @@ -265,7 +266,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd, } if (_IOC_DIR(cmd) & _IOC_READ) - ret = put_user(val, (__u32 *)arg); + ret = put_user(val, argp); return ret; } |