aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-10-06 01:41:06 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-10-11 16:48:36 -0400
commit06bd801c23939952bc6e1cf65f0e8c0fff09d2d7 (patch)
tree7a42a82e6a8eb6bf2a5f40d4ef36fe613024cea8 /drivers/media/rc
parente30528854797f057aa6ffb6dc9f890e923c467fd (diff)
[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')
-rw-r--r--drivers/media/rc/ir-lirc-codec.c9
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 e5eeec4da76e..ec2e67fd236b 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)
98 return 0; 98 return 0;
99} 99}
100 100
101static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf, 101static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
102 size_t n, loff_t *ppos) 102 size_t n, loff_t *ppos)
103{ 103{
104 struct lirc_codec *lirc; 104 struct lirc_codec *lirc;
@@ -140,10 +140,11 @@ out:
140} 140}
141 141
142static long ir_lirc_ioctl(struct file *filep, unsigned int cmd, 142static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
143 unsigned long __user arg) 143 unsigned long arg)
144{ 144{
145 struct lirc_codec *lirc; 145 struct lirc_codec *lirc;
146 struct rc_dev *dev; 146 struct rc_dev *dev;
147 u32 __user *argp = (u32 __user *)(arg);
147 int ret = 0; 148 int ret = 0;
148 __u32 val = 0, tmp; 149 __u32 val = 0, tmp;
149 150
@@ -156,7 +157,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
156 return -EFAULT; 157 return -EFAULT;
157 158
158 if (_IOC_DIR(cmd) & _IOC_WRITE) { 159 if (_IOC_DIR(cmd) & _IOC_WRITE) {
159 ret = get_user(val, (__u32 *)arg); 160 ret = get_user(val, argp);
160 if (ret) 161 if (ret)
161 return ret; 162 return ret;
162 } 163 }
@@ -265,7 +266,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
265 } 266 }
266 267
267 if (_IOC_DIR(cmd) & _IOC_READ) 268 if (_IOC_DIR(cmd) & _IOC_READ)
268 ret = put_user(val, (__u32 *)arg); 269 ret = put_user(val, argp);
269 270
270 return ret; 271 return ret;
271} 272}