Commit ffb99752 authored by Jasminko Dedic's avatar Jasminko Dedic Committed by Greg Kroah-Hartman

staging: vc04_services: add missing __user annotations

This patch fixes the following sparse warnings by adding missing __user
annotations. It also cleans up two related unnecessary casts by reuseing
casts already made a few lines up. Remaining sparse warnings are of a
different type.

vchiq_arm.c:1606:14: warning: incorrect type in assignment (different address spaces)
vchiq_arm.c:1606:14:    expected struct vchiq_queue_message *args
vchiq_arm.c:1606:14:    got void [noderef] <asn:1> *

vchiq_arm.c:1612:13: warning: incorrect type in argument 1 (different address spaces)
vchiq_arm.c:1612:13:    expected void const volatile [noderef] <asn:1> *
vchiq_arm.c:1612:13:    got unsigned int *

vchiq_arm.c:1613:13: warning: incorrect type in argument 1 (different address spaces)
vchiq_arm.c:1613:13:    expected void const volatile [noderef] <asn:1> *
vchiq_arm.c:1613:13:    got unsigned int *

vchiq_arm.c:1614:13: warning: incorrect type in argument 1 (different address spaces)
vchiq_arm.c:1614:13:    expected void const volatile [noderef] <asn:1> *
vchiq_arm.c:1614:13:    got struct vchiq_element const [noderef] <asn:1> **

vchiq_arm.c:1638:21: warning: incorrect type in argument 1 (different address spaces)
vchiq_arm.c:1638:21:    expected void const volatile [noderef] <asn:1> *
vchiq_arm.c:1638:21:    got struct vchiq_element const [noderef] <asn:1> **
Signed-off-by: default avatarJasminko Dedic <betelge@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b6e24d0e
...@@ -1540,9 +1540,7 @@ vchiq_compat_ioctl_create_service( ...@@ -1540,9 +1540,7 @@ vchiq_compat_ioctl_create_service(
if (!args) if (!args)
return -EFAULT; return -EFAULT;
if (copy_from_user(&args32, if (copy_from_user(&args32, ptrargs32, sizeof(args32)))
(struct vchiq_create_service32 __user *)arg,
sizeof(args32)))
return -EFAULT; return -EFAULT;
if (put_user(args32.params.fourcc, &args->params.fourcc) || if (put_user(args32.params.fourcc, &args->params.fourcc) ||
...@@ -1593,7 +1591,7 @@ vchiq_compat_ioctl_queue_message(struct file *file, ...@@ -1593,7 +1591,7 @@ vchiq_compat_ioctl_queue_message(struct file *file,
unsigned int cmd, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
struct vchiq_queue_message *args; struct vchiq_queue_message __user *args;
struct vchiq_element __user *elements; struct vchiq_element __user *elements;
struct vchiq_queue_message32 args32; struct vchiq_queue_message32 args32;
unsigned int count; unsigned int count;
...@@ -1662,17 +1660,15 @@ vchiq_compat_ioctl_queue_bulk(struct file *file, ...@@ -1662,17 +1660,15 @@ vchiq_compat_ioctl_queue_bulk(struct file *file,
{ {
struct vchiq_queue_bulk_transfer __user *args; struct vchiq_queue_bulk_transfer __user *args;
struct vchiq_queue_bulk_transfer32 args32; struct vchiq_queue_bulk_transfer32 args32;
struct vchiq_queue_bulk_transfer32 *ptrargs32 = struct vchiq_queue_bulk_transfer32 __user *ptrargs32 =
(struct vchiq_queue_bulk_transfer32 *)arg; (struct vchiq_queue_bulk_transfer32 __user *)arg;
long ret; long ret;
args = compat_alloc_user_space(sizeof(*args)); args = compat_alloc_user_space(sizeof(*args));
if (!args) if (!args)
return -EFAULT; return -EFAULT;
if (copy_from_user(&args32, if (copy_from_user(&args32, ptrargs32, sizeof(args32)))
(struct vchiq_queue_bulk_transfer32 __user *)arg,
sizeof(args32)))
return -EFAULT; return -EFAULT;
if (put_user(args32.handle, &args->handle) || if (put_user(args32.handle, &args->handle) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment