aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/bt8xx/dst_ca.c
diff options
context:
space:
mode:
authorPeter Hagervall <hager@cs.umu.se>2005-11-09 00:35:18 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:56:02 -0500
commit174f80dfcba45677f12ba57479d03750dd9cad7b (patch)
tree4c5e3defa06e6758d6a1ae9f97b484a405cb9fb1 /drivers/media/dvb/bt8xx/dst_ca.c
parent93a14f15d35cd60742220995d3413d256ebde9ee (diff)
[PATCH] dvb: fix sparse warnings
Sparse warnings - remove address space related warnings Signed-off-by: Peter Hagervall <hager@cs.umu.se> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Cc: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/bt8xx/dst_ca.c')
-rw-r--r--drivers/media/dvb/bt8xx/dst_ca.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index 8a8a3333cb8f..492e829fe021 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -166,7 +166,7 @@ static int ca_get_app_info(struct dst_state *state)
166 return 0; 166 return 0;
167} 167}
168 168
169static int ca_get_slot_caps(struct dst_state *state, struct ca_caps *p_ca_caps, void *arg) 169static int ca_get_slot_caps(struct dst_state *state, struct ca_caps *p_ca_caps, void __user *arg)
170{ 170{
171 int i; 171 int i;
172 u8 slot_cap[256]; 172 u8 slot_cap[256];
@@ -192,20 +192,20 @@ static int ca_get_slot_caps(struct dst_state *state, struct ca_caps *p_ca_caps,
192 p_ca_caps->descr_num = slot_cap[7]; 192 p_ca_caps->descr_num = slot_cap[7];
193 p_ca_caps->descr_type = 1; 193 p_ca_caps->descr_type = 1;
194 194
195 if (copy_to_user((struct ca_caps *)arg, p_ca_caps, sizeof (struct ca_caps))) 195 if (copy_to_user(arg, p_ca_caps, sizeof (struct ca_caps)))
196 return -EFAULT; 196 return -EFAULT;
197 197
198 return 0; 198 return 0;
199} 199}
200 200
201/* Need some more work */ 201/* Need some more work */
202static int ca_get_slot_descr(struct dst_state *state, struct ca_msg *p_ca_message, void *arg) 202static int ca_get_slot_descr(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg)
203{ 203{
204 return -EOPNOTSUPP; 204 return -EOPNOTSUPP;
205} 205}
206 206
207 207
208static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_slot_info, void *arg) 208static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_slot_info, void __user *arg)
209{ 209{
210 int i; 210 int i;
211 static u8 slot_command[8] = {0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff}; 211 static u8 slot_command[8] = {0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff};
@@ -238,19 +238,19 @@ static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_s
238 } else 238 } else
239 p_ca_slot_info->flags = 0; 239 p_ca_slot_info->flags = 0;
240 240
241 if (copy_to_user((struct ca_slot_info *)arg, p_ca_slot_info, sizeof (struct ca_slot_info))) 241 if (copy_to_user(arg, p_ca_slot_info, sizeof (struct ca_slot_info)))
242 return -EFAULT; 242 return -EFAULT;
243 243
244 return 0; 244 return 0;
245} 245}
246 246
247 247
248static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message, void *arg) 248static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg)
249{ 249{
250 u8 i = 0; 250 u8 i = 0;
251 u32 command = 0; 251 u32 command = 0;
252 252
253 if (copy_from_user(p_ca_message, (void *)arg, sizeof (struct ca_msg))) 253 if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg)))
254 return -EFAULT; 254 return -EFAULT;
255 255
256 if (p_ca_message->msg) { 256 if (p_ca_message->msg) {
@@ -266,7 +266,7 @@ static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message,
266 switch (command) { 266 switch (command) {
267 case CA_APP_INFO: 267 case CA_APP_INFO:
268 memcpy(p_ca_message->msg, state->messages, 128); 268 memcpy(p_ca_message->msg, state->messages, 128);
269 if (copy_to_user((void *)arg, p_ca_message, sizeof (struct ca_msg)) ) 269 if (copy_to_user(arg, p_ca_message, sizeof (struct ca_msg)) )
270 return -EFAULT; 270 return -EFAULT;
271 break; 271 break;
272 } 272 }
@@ -315,7 +315,7 @@ static int write_to_8820(struct dst_state *state, struct ca_msg *hw_buffer, u8 l
315 return 0; 315 return 0;
316} 316}
317 317
318u32 asn_1_decode(u8 *asn_1_array) 318static u32 asn_1_decode(u8 *asn_1_array)
319{ 319{
320 u8 length_field = 0, word_count = 0, count = 0; 320 u8 length_field = 0, word_count = 0, count = 0;
321 u32 length = 0; 321 u32 length = 0;
@@ -400,7 +400,7 @@ static int dst_check_ca_pmt(struct dst_state *state, struct ca_msg *p_ca_message
400 return 0; 400 return 0;
401} 401}
402 402
403static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, void *arg) 403static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg)
404{ 404{
405 int i = 0; 405 int i = 0;
406 unsigned int ca_message_header_len; 406 unsigned int ca_message_header_len;
@@ -414,7 +414,7 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message,
414 } 414 }
415 dprintk(verbose, DST_CA_DEBUG, 1, " "); 415 dprintk(verbose, DST_CA_DEBUG, 1, " ");
416 416
417 if (copy_from_user(p_ca_message, (void *)arg, sizeof (struct ca_msg))) 417 if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg)))
418 return -EFAULT; 418 return -EFAULT;
419 419
420 if (p_ca_message->msg) { 420 if (p_ca_message->msg) {
@@ -461,13 +461,14 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message,
461 return 0; 461 return 0;
462} 462}
463 463
464static int dst_ca_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg) 464static int dst_ca_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long ioctl_arg)
465{ 465{
466 struct dvb_device* dvbdev = (struct dvb_device*) file->private_data; 466 struct dvb_device* dvbdev = (struct dvb_device*) file->private_data;
467 struct dst_state* state = (struct dst_state*) dvbdev->priv; 467 struct dst_state* state = (struct dst_state*) dvbdev->priv;
468 struct ca_slot_info *p_ca_slot_info; 468 struct ca_slot_info *p_ca_slot_info;
469 struct ca_caps *p_ca_caps; 469 struct ca_caps *p_ca_caps;
470 struct ca_msg *p_ca_message; 470 struct ca_msg *p_ca_message;
471 void __user *arg = (void __user *)ioctl_arg;
471 472
472 if ((p_ca_message = (struct ca_msg *) kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) { 473 if ((p_ca_message = (struct ca_msg *) kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) {
473 dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); 474 dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure");
@@ -583,7 +584,7 @@ static int dst_ca_write(struct file *file, const char __user *buffer, size_t len
583 584
584static struct file_operations dst_ca_fops = { 585static struct file_operations dst_ca_fops = {
585 .owner = THIS_MODULE, 586 .owner = THIS_MODULE,
586 .ioctl = (void *)dst_ca_ioctl, 587 .ioctl = dst_ca_ioctl,
587 .open = dst_ca_open, 588 .open = dst_ca_open,
588 .release = dst_ca_release, 589 .release = dst_ca_release,
589 .read = dst_ca_read, 590 .read = dst_ca_read,