diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-12-11 10:25:01 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-01-11 15:19:03 +0100 |
commit | b83e250833e6c40a9e92935ea6fc125b64792357 (patch) | |
tree | 25d5f300c85cadeefe8463e6aaf3f5a723f3428d | |
parent | [media] media-device: put headers in alphabetic order (diff) | |
download | linux-b83e250833e6c40a9e92935ea6fc125b64792357.tar.xz linux-b83e250833e6c40a9e92935ea6fc125b64792357.zip |
[media] media-device: better name Kernelspace/Userspace links
The __media_device_enum_links() copies links definitions from
Kernelspace to userspace. It has to work with 3 structs that
handle with links. Better name them to:
link: Kernelspace internal link representation, of the
type media_link;
klink_desc: struct media_link_desc pointer to the
kernel memory where the data will be filled;
ulink_desc: struct media_link_desc pointer to the
memory where the data will be copied to
userspace.
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/media-device.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 61883abaf095..14bd568e2f41 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -151,24 +151,25 @@ static long __media_device_enum_links(struct media_device *mdev, } if (links->links) { - struct media_link *ent_link; - struct media_link_desc __user *ulink = links->links; + struct media_link *link; + struct media_link_desc __user *ulink_desc = links->links; - list_for_each_entry(ent_link, &entity->links, list) { - struct media_link_desc link; + list_for_each_entry(link, &entity->links, list) { + struct media_link_desc klink_desc; /* Ignore backlinks. */ - if (ent_link->source->entity != entity) + if (link->source->entity != entity) continue; - memset(&link, 0, sizeof(link)); - media_device_kpad_to_upad(ent_link->source, - &link.source); - media_device_kpad_to_upad(ent_link->sink, - &link.sink); - link.flags = ent_link->flags; - if (copy_to_user(ulink, &link, sizeof(*ulink))) + memset(&klink_desc, 0, sizeof(klink_desc)); + media_device_kpad_to_upad(link->source, + &klink_desc.source); + media_device_kpad_to_upad(link->sink, + &klink_desc.sink); + klink_desc.flags = link->flags; + if (copy_to_user(ulink_desc, &klink_desc, + sizeof(*ulink_desc))) return -EFAULT; - ulink++; + ulink_desc++; } } |