Skip to content

Commit 60519af

Browse files
Hans Verkuilmchehab
authored andcommitted
[media] lirc_dev: fix sparse warnings
drivers/media/rc/lirc_dev.c:598:26: warning: incorrect type in argument 1 (different address spaces) drivers/media/rc/lirc_dev.c:606:26: warning: incorrect type in argument 1 (different address spaces) drivers/media/rc/lirc_dev.c:616:26: warning: incorrect type in argument 1 (different address spaces) drivers/media/rc/lirc_dev.c:625:26: warning: incorrect type in argument 1 (different address spaces) drivers/media/rc/lirc_dev.c:634:26: warning: incorrect type in argument 1 (different address spaces) drivers/media/rc/lirc_dev.c:643:26: warning: incorrect type in argument 1 (different address spaces) drivers/media/rc/lirc_dev.c:739:45: warning: cast removes address space of expression drivers/media/rc/lirc_dev.c:739:58: warning: incorrect type in argument 1 (different address spaces) Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
1 parent 4d1afa5 commit 60519af

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎drivers/media/rc/lirc_dev.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
595595

596596
switch (cmd) {
597597
case LIRC_GET_FEATURES:
598-
result = put_user(ir->d.features, (__u32 *)arg);
598+
result = put_user(ir->d.features, (__u32 __user *)arg);
599599
break;
600600
case LIRC_GET_REC_MODE:
601601
if (!(ir->d.features & LIRC_CAN_REC_MASK)) {
@@ -605,15 +605,15 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
605605

606606
result = put_user(LIRC_REC2MODE
607607
(ir->d.features & LIRC_CAN_REC_MASK),
608-
(__u32 *)arg);
608+
(__u32 __user *)arg);
609609
break;
610610
case LIRC_SET_REC_MODE:
611611
if (!(ir->d.features & LIRC_CAN_REC_MASK)) {
612612
result = -ENOSYS;
613613
break;
614614
}
615615

616-
result = get_user(mode, (__u32 *)arg);
616+
result = get_user(mode, (__u32 __user *)arg);
617617
if (!result && !(LIRC_MODE2REC(mode) & ir->d.features))
618618
result = -EINVAL;
619619
/*
@@ -622,7 +622,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
622622
*/
623623
break;
624624
case LIRC_GET_LENGTH:
625-
result = put_user(ir->d.code_length, (__u32 *)arg);
625+
result = put_user(ir->d.code_length, (__u32 __user *)arg);
626626
break;
627627
case LIRC_GET_MIN_TIMEOUT:
628628
if (!(ir->d.features & LIRC_CAN_SET_REC_TIMEOUT) ||
@@ -631,7 +631,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
631631
break;
632632
}
633633

634-
result = put_user(ir->d.min_timeout, (__u32 *)arg);
634+
result = put_user(ir->d.min_timeout, (__u32 __user *)arg);
635635
break;
636636
case LIRC_GET_MAX_TIMEOUT:
637637
if (!(ir->d.features & LIRC_CAN_SET_REC_TIMEOUT) ||
@@ -640,7 +640,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
640640
break;
641641
}
642642

643-
result = put_user(ir->d.max_timeout, (__u32 *)arg);
643+
result = put_user(ir->d.max_timeout, (__u32 __user *)arg);
644644
break;
645645
default:
646646
result = -EINVAL;
@@ -736,7 +736,7 @@ ssize_t lirc_dev_fop_read(struct file *file,
736736
}
737737
} else {
738738
lirc_buffer_read(ir->buf, buf);
739-
ret = copy_to_user((void *)buffer+written, buf,
739+
ret = copy_to_user((void __user *)buffer+written, buf,
740740
ir->buf->chunk_size);
741741
if (!ret)
742742
written += ir->buf->chunk_size;

0 commit comments

Comments
 (0)