media: v4l2-compat-ioctl32.c: fix the indentation

commit b7b957d429f601d6d1942122b339474f31191d75 upstream.

The indentation of this source is all over the place. Fix this.
This patch only changes whitespace.

Change-Id: Ie22cdb7106d4463902de3d06c2681437f42960e5
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
[bwh: Rebased on top of some earlier fixes]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Hans Verkuil 2018-02-14 12:59:29 +01:00 committed by syphyr
parent 9ca97e5979
commit a0f5318a9f

View file

@ -48,11 +48,11 @@ struct v4l2_window32 {
static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up)
{ {
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_window32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_window32)) ||
copy_from_user(&kp->w, &up->w, sizeof(up->w)) || copy_from_user(&kp->w, &up->w, sizeof(up->w)) ||
get_user(kp->field, &up->field) || get_user(kp->field, &up->field) ||
get_user(kp->chromakey, &up->chromakey) || get_user(kp->chromakey, &up->chromakey) ||
get_user(kp->clipcount, &up->clipcount)) get_user(kp->clipcount, &up->clipcount))
return -EFAULT; return -EFAULT;
if (kp->clipcount > 2048) if (kp->clipcount > 2048)
return -EINVAL; return -EINVAL;
if (kp->clipcount) { if (kp->clipcount) {
@ -82,10 +82,10 @@ static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user
static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up)
{ {
if (copy_to_user(&up->w, &kp->w, sizeof(kp->w)) || if (copy_to_user(&up->w, &kp->w, sizeof(kp->w)) ||
put_user(kp->field, &up->field) || put_user(kp->field, &up->field) ||
put_user(kp->chromakey, &up->chromakey) || put_user(kp->chromakey, &up->chromakey) ||
put_user(kp->clipcount, &up->clipcount)) put_user(kp->clipcount, &up->clipcount))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
@ -97,7 +97,7 @@ static inline int get_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pi
} }
static inline int get_v4l2_pix_format_mplane(struct v4l2_pix_format_mplane *kp, static inline int get_v4l2_pix_format_mplane(struct v4l2_pix_format_mplane *kp,
struct v4l2_pix_format_mplane __user *up) struct v4l2_pix_format_mplane __user *up)
{ {
if (copy_from_user(kp, up, sizeof(struct v4l2_pix_format_mplane))) if (copy_from_user(kp, up, sizeof(struct v4l2_pix_format_mplane)))
return -EFAULT; return -EFAULT;
@ -112,7 +112,7 @@ static inline int put_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pi
} }
static inline int put_v4l2_pix_format_mplane(struct v4l2_pix_format_mplane *kp, static inline int put_v4l2_pix_format_mplane(struct v4l2_pix_format_mplane *kp,
struct v4l2_pix_format_mplane __user *up) struct v4l2_pix_format_mplane __user *up)
{ {
if (copy_to_user(up, kp, sizeof(struct v4l2_pix_format_mplane))) if (copy_to_user(up, kp, sizeof(struct v4l2_pix_format_mplane)))
return -EFAULT; return -EFAULT;
@ -200,7 +200,7 @@ static int __get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us
return get_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced); return get_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced);
default: default:
printk(KERN_INFO "compat_ioctl32: unexpected VIDIOC_FMT type %d\n", printk(KERN_INFO "compat_ioctl32: unexpected VIDIOC_FMT type %d\n",
kp->type); kp->type);
return -EINVAL; return -EINVAL;
} }
} }
@ -244,7 +244,7 @@ static int __put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us
return put_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced); return put_v4l2_sliced_vbi_format(&kp->fmt.sliced, &up->fmt.sliced);
default: default:
printk(KERN_INFO "compat_ioctl32: unexpected VIDIOC_FMT type %d\n", printk(KERN_INFO "compat_ioctl32: unexpected VIDIOC_FMT type %d\n",
kp->type); kp->type);
return -EINVAL; return -EINVAL;
} }
} }
@ -278,7 +278,7 @@ static int get_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32
{ {
/* other fields are not set by the user, nor used by the driver */ /* other fields are not set by the user, nor used by the driver */
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard32)) ||
get_user(kp->index, &up->index)) get_user(kp->index, &up->index))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
@ -286,13 +286,13 @@ static int get_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32
static int put_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 __user *up) static int put_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 __user *up)
{ {
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard32)) ||
put_user(kp->index, &up->index) || put_user(kp->index, &up->index) ||
put_user(kp->id, &up->id) || put_user(kp->id, &up->id) ||
copy_to_user(up->name, kp->name, 24) || copy_to_user(up->name, kp->name, 24) ||
copy_to_user(&up->frameperiod, &kp->frameperiod, sizeof(kp->frameperiod)) || copy_to_user(&up->frameperiod, &kp->frameperiod, sizeof(kp->frameperiod)) ||
put_user(kp->framelines, &up->framelines) || put_user(kp->framelines, &up->framelines) ||
copy_to_user(up->reserved, kp->reserved, 4 * sizeof(__u32))) copy_to_user(up->reserved, kp->reserved, 4 * sizeof(__u32)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
@ -332,18 +332,18 @@ struct v4l2_buffer32 {
}; };
static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __user *up32, static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __user *up32,
enum v4l2_memory memory) enum v4l2_memory memory)
{ {
void __user *up_pln; void __user *up_pln;
compat_long_t p; compat_long_t p;
if (copy_in_user(up, up32, 2 * sizeof(__u32)) || if (copy_in_user(up, up32, 2 * sizeof(__u32)) ||
copy_in_user(&up->data_offset, &up32->data_offset, copy_in_user(&up->data_offset, &up32->data_offset,
sizeof(__u32)) || sizeof(__u32)) ||
copy_in_user(up->reserved, up32->reserved, copy_in_user(up->reserved, up32->reserved,
sizeof(up->reserved)) || sizeof(up->reserved)) ||
copy_in_user(&up->length, &up32->length, copy_in_user(&up->length, &up32->length,
sizeof(__u32))) sizeof(__u32)))
return -EFAULT; return -EFAULT;
if (memory == V4L2_MEMORY_USERPTR) { if (memory == V4L2_MEMORY_USERPTR) {
@ -357,7 +357,7 @@ static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __
return -EFAULT; return -EFAULT;
} else { } else {
if (copy_in_user(&up->m.mem_offset, &up32->m.mem_offset, if (copy_in_user(&up->m.mem_offset, &up32->m.mem_offset,
sizeof(__u32))) sizeof(__u32)))
return -EFAULT; return -EFAULT;
} }
@ -365,25 +365,25 @@ static int get_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __
} }
static int put_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __user *up32, static int put_v4l2_plane32(struct v4l2_plane __user *up, struct v4l2_plane32 __user *up32,
enum v4l2_memory memory) enum v4l2_memory memory)
{ {
if (copy_in_user(up32, up, 2 * sizeof(__u32)) || if (copy_in_user(up32, up, 2 * sizeof(__u32)) ||
copy_in_user(up32->reserved, up->reserved, copy_in_user(up32->reserved, up->reserved,
sizeof(up32->reserved)) || sizeof(up32->reserved)) ||
copy_in_user(&up32->data_offset, &up->data_offset, copy_in_user(&up32->data_offset, &up->data_offset,
sizeof(__u32))) sizeof(__u32)))
return -EFAULT; return -EFAULT;
/* For MMAP, driver might've set up the offset, so copy it back. /* For MMAP, driver might've set up the offset, so copy it back.
* USERPTR stays the same (was userspace-provided), so no copying. */ * USERPTR stays the same (was userspace-provided), so no copying. */
if (memory == V4L2_MEMORY_MMAP) if (memory == V4L2_MEMORY_MMAP)
if (copy_in_user(&up32->m.mem_offset, &up->m.mem_offset, if (copy_in_user(&up32->m.mem_offset, &up->m.mem_offset,
sizeof(__u32))) sizeof(__u32)))
return -EFAULT; return -EFAULT;
/* For DMABUF, driver might've set up the fd, so copy it back. */ /* For DMABUF, driver might've set up the fd, so copy it back. */
if (memory == V4L2_MEMORY_DMABUF) if (memory == V4L2_MEMORY_DMABUF)
if (copy_in_user(&up32->m.fd, &up->m.fd, if (copy_in_user(&up32->m.fd, &up->m.fd,
sizeof(int))) sizeof(int)))
return -EFAULT; return -EFAULT;
return 0; return 0;
@ -398,19 +398,19 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
int ret; int ret;
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_buffer32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_buffer32)) ||
get_user(kp->index, &up->index) || get_user(kp->index, &up->index) ||
get_user(kp->type, &up->type) || get_user(kp->type, &up->type) ||
get_user(kp->flags, &up->flags) || get_user(kp->flags, &up->flags) ||
get_user(kp->memory, &up->memory) || get_user(kp->memory, &up->memory) ||
get_user(kp->length, &up->length)) get_user(kp->length, &up->length))
return -EFAULT; return -EFAULT;
if (V4L2_TYPE_IS_OUTPUT(kp->type)) if (V4L2_TYPE_IS_OUTPUT(kp->type))
if (get_user(kp->bytesused, &up->bytesused) || if (get_user(kp->bytesused, &up->bytesused) ||
get_user(kp->field, &up->field) || get_user(kp->field, &up->field) ||
get_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) || get_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) ||
get_user(kp->timestamp.tv_usec, get_user(kp->timestamp.tv_usec,
&up->timestamp.tv_usec)) &up->timestamp.tv_usec))
return -EFAULT; return -EFAULT;
if (V4L2_TYPE_IS_PRIVATE(kp->type)) { if (V4L2_TYPE_IS_PRIVATE(kp->type)) {
@ -437,13 +437,13 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
uplane32 = compat_ptr(p); uplane32 = compat_ptr(p);
if (!access_ok(VERIFY_READ, uplane32, if (!access_ok(VERIFY_READ, uplane32,
num_planes * sizeof(struct v4l2_plane32))) num_planes * sizeof(struct v4l2_plane32)))
return -EFAULT; return -EFAULT;
/* We don't really care if userspace decides to kill itself /* We don't really care if userspace decides to kill itself
* by passing a very big num_planes value */ * by passing a very big num_planes value */
uplane = compat_alloc_user_space(num_planes * uplane = compat_alloc_user_space(num_planes *
sizeof(struct v4l2_plane)); sizeof(struct v4l2_plane));
kp->m.planes = (__force struct v4l2_plane *)uplane; kp->m.planes = (__force struct v4l2_plane *)uplane;
while (--num_planes >= 0) { while (--num_planes >= 0) {
@ -461,12 +461,12 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
break; break;
case V4L2_MEMORY_USERPTR: case V4L2_MEMORY_USERPTR:
{ {
compat_long_t tmp; compat_long_t tmp;
if (get_user(tmp, &up->m.userptr)) if (get_user(tmp, &up->m.userptr))
return -EFAULT; return -EFAULT;
kp->m.userptr = (unsigned long)compat_ptr(tmp); kp->m.userptr = (unsigned long)compat_ptr(tmp);
} }
break; break;
case V4L2_MEMORY_OVERLAY: case V4L2_MEMORY_OVERLAY:
@ -492,22 +492,22 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
int ret; int ret;
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_buffer32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_buffer32)) ||
put_user(kp->index, &up->index) || put_user(kp->index, &up->index) ||
put_user(kp->type, &up->type) || put_user(kp->type, &up->type) ||
put_user(kp->flags, &up->flags) || put_user(kp->flags, &up->flags) ||
put_user(kp->memory, &up->memory)) put_user(kp->memory, &up->memory))
return -EFAULT; return -EFAULT;
if (put_user(kp->bytesused, &up->bytesused) || if (put_user(kp->bytesused, &up->bytesused) ||
put_user(kp->field, &up->field) || put_user(kp->field, &up->field) ||
put_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) || put_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) ||
put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) || put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) ||
copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) || copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) ||
put_user(kp->sequence, &up->sequence) || put_user(kp->sequence, &up->sequence) ||
put_user(kp->reserved2, &up->reserved2) || put_user(kp->reserved2, &up->reserved2) ||
put_user(kp->reserved, &up->reserved) || put_user(kp->reserved, &up->reserved) ||
put_user(kp->length, &up->length)) put_user(kp->length, &up->length))
return -EFAULT; return -EFAULT;
if (V4L2_TYPE_IS_PRIVATE(kp->type)) { if (V4L2_TYPE_IS_PRIVATE(kp->type)) {
if (put_user(kp->length, &up->length) || if (put_user(kp->length, &up->length) ||
@ -568,10 +568,10 @@ static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
u32 tmp; u32 tmp;
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_framebuffer32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_framebuffer32)) ||
get_user(tmp, &up->base) || get_user(tmp, &up->base) ||
get_user(kp->capability, &up->capability) || get_user(kp->capability, &up->capability) ||
get_user(kp->flags, &up->flags)) get_user(kp->flags, &up->flags))
return -EFAULT; return -EFAULT;
kp->base = (__force void *)compat_ptr(tmp); kp->base = (__force void *)compat_ptr(tmp);
get_v4l2_pix_format(&kp->fmt, &up->fmt); get_v4l2_pix_format(&kp->fmt, &up->fmt);
return 0; return 0;
@ -582,10 +582,10 @@ static int put_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame
u32 tmp = (u32)((unsigned long)kp->base); u32 tmp = (u32)((unsigned long)kp->base);
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_framebuffer32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_framebuffer32)) ||
put_user(tmp, &up->base) || put_user(tmp, &up->base) ||
put_user(kp->capability, &up->capability) || put_user(kp->capability, &up->capability) ||
put_user(kp->flags, &up->flags)) put_user(kp->flags, &up->flags))
return -EFAULT; return -EFAULT;
put_v4l2_pix_format(&kp->fmt, &up->fmt); put_v4l2_pix_format(&kp->fmt, &up->fmt);
return 0; return 0;
} }
@ -619,11 +619,11 @@ static inline int put_v4l2_input32(struct v4l2_input *kp, struct v4l2_input32 __
} }
struct v4l2_ext_controls32 { struct v4l2_ext_controls32 {
__u32 ctrl_class; __u32 ctrl_class;
__u32 count; __u32 count;
__u32 error_idx; __u32 error_idx;
__u32 reserved[2]; __u32 reserved[2];
compat_caddr_t controls; /* actually struct v4l2_ext_control32 * */ compat_caddr_t controls; /* actually struct v4l2_ext_control32 * */
}; };
struct v4l2_ext_control32 { struct v4l2_ext_control32 {
@ -662,11 +662,11 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
compat_caddr_t p; compat_caddr_t p;
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_ext_controls32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_ext_controls32)) ||
get_user(kp->ctrl_class, &up->ctrl_class) || get_user(kp->ctrl_class, &up->ctrl_class) ||
get_user(kp->count, &up->count) || get_user(kp->count, &up->count) ||
get_user(kp->error_idx, &up->error_idx) || get_user(kp->error_idx, &up->error_idx) ||
copy_from_user(kp->reserved, up->reserved, sizeof(kp->reserved))) copy_from_user(kp->reserved, up->reserved, sizeof(kp->reserved)))
return -EFAULT; return -EFAULT;
n = kp->count; n = kp->count;
if (n == 0) { if (n == 0) {
kp->controls = NULL; kp->controls = NULL;
@ -676,7 +676,7 @@ static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
return -EFAULT; return -EFAULT;
ucontrols = compat_ptr(p); ucontrols = compat_ptr(p);
if (!access_ok(VERIFY_READ, ucontrols, if (!access_ok(VERIFY_READ, ucontrols,
n * sizeof(struct v4l2_ext_control32))) n * sizeof(struct v4l2_ext_control32)))
return -EFAULT; return -EFAULT;
kcontrols = compat_alloc_user_space(n * sizeof(struct v4l2_ext_control)); kcontrols = compat_alloc_user_space(n * sizeof(struct v4l2_ext_control));
kp->controls = (__force struct v4l2_ext_control *)kcontrols; kp->controls = (__force struct v4l2_ext_control *)kcontrols;
@ -711,11 +711,11 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
compat_caddr_t p; compat_caddr_t p;
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_ext_controls32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_ext_controls32)) ||
put_user(kp->ctrl_class, &up->ctrl_class) || put_user(kp->ctrl_class, &up->ctrl_class) ||
put_user(kp->count, &up->count) || put_user(kp->count, &up->count) ||
put_user(kp->error_idx, &up->error_idx) || put_user(kp->error_idx, &up->error_idx) ||
copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved))) copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved)))
return -EFAULT; return -EFAULT;
if (!kp->count) if (!kp->count)
return 0; return 0;
@ -723,7 +723,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
return -EFAULT; return -EFAULT;
ucontrols = compat_ptr(p); ucontrols = compat_ptr(p);
if (!access_ok(VERIFY_WRITE, ucontrols, if (!access_ok(VERIFY_WRITE, ucontrols,
n * sizeof(struct v4l2_ext_control32))) n * sizeof(struct v4l2_ext_control32)))
return -EFAULT; return -EFAULT;
while (--n >= 0) { while (--n >= 0) {
@ -761,14 +761,14 @@ struct v4l2_event32 {
static int put_v4l2_event32(struct v4l2_event *kp, struct v4l2_event32 __user *up) static int put_v4l2_event32(struct v4l2_event *kp, struct v4l2_event32 __user *up)
{ {
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_event32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_event32)) ||
put_user(kp->type, &up->type) || put_user(kp->type, &up->type) ||
copy_to_user(&up->u, &kp->u, sizeof(kp->u)) || copy_to_user(&up->u, &kp->u, sizeof(kp->u)) ||
put_user(kp->pending, &up->pending) || put_user(kp->pending, &up->pending) ||
put_user(kp->sequence, &up->sequence) || put_user(kp->sequence, &up->sequence) ||
put_compat_timespec(&kp->timestamp, &up->timestamp) || put_compat_timespec(&kp->timestamp, &up->timestamp) ||
put_user(kp->id, &up->id) || put_user(kp->id, &up->id) ||
copy_to_user(up->reserved, kp->reserved, 8 * sizeof(__u32))) copy_to_user(up->reserved, kp->reserved, 8 * sizeof(__u32)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
@ -785,12 +785,12 @@ static int get_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct v4l2_subde
u32 tmp; u32 tmp;
if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_subdev_edid32)) || if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_subdev_edid32)) ||
get_user(kp->pad, &up->pad) || get_user(kp->pad, &up->pad) ||
get_user(kp->start_block, &up->start_block) || get_user(kp->start_block, &up->start_block) ||
get_user(kp->blocks, &up->blocks) || get_user(kp->blocks, &up->blocks) ||
get_user(tmp, &up->edid) || get_user(tmp, &up->edid) ||
copy_from_user(kp->reserved, up->reserved, sizeof(kp->reserved))) copy_from_user(kp->reserved, up->reserved, sizeof(kp->reserved)))
return -EFAULT; return -EFAULT;
kp->edid = (__force u8 *)compat_ptr(tmp); kp->edid = (__force u8 *)compat_ptr(tmp);
return 0; return 0;
} }
@ -800,12 +800,12 @@ static int put_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct v4l2_subde
u32 tmp = (u32)((unsigned long)kp->edid); u32 tmp = (u32)((unsigned long)kp->edid);
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_subdev_edid32)) || if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_subdev_edid32)) ||
put_user(kp->pad, &up->pad) || put_user(kp->pad, &up->pad) ||
put_user(kp->start_block, &up->start_block) || put_user(kp->start_block, &up->start_block) ||
put_user(kp->blocks, &up->blocks) || put_user(kp->blocks, &up->blocks) ||
put_user(tmp, &up->edid) || put_user(tmp, &up->edid) ||
copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved))) copy_to_user(up->reserved, kp->reserved, sizeof(up->reserved)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }