mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-21 06:24:12 +00:00
[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>
This commit is contained in:
parent
497e80cdf9
commit
b83e250833
1 changed files with 14 additions and 13 deletions
|
@ -151,24 +151,25 @@ static long __media_device_enum_links(struct media_device *mdev,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (links->links) {
|
if (links->links) {
|
||||||
struct media_link *ent_link;
|
struct media_link *link;
|
||||||
struct media_link_desc __user *ulink = links->links;
|
struct media_link_desc __user *ulink_desc = links->links;
|
||||||
|
|
||||||
list_for_each_entry(ent_link, &entity->links, list) {
|
list_for_each_entry(link, &entity->links, list) {
|
||||||
struct media_link_desc link;
|
struct media_link_desc klink_desc;
|
||||||
|
|
||||||
/* Ignore backlinks. */
|
/* Ignore backlinks. */
|
||||||
if (ent_link->source->entity != entity)
|
if (link->source->entity != entity)
|
||||||
continue;
|
continue;
|
||||||
memset(&link, 0, sizeof(link));
|
memset(&klink_desc, 0, sizeof(klink_desc));
|
||||||
media_device_kpad_to_upad(ent_link->source,
|
media_device_kpad_to_upad(link->source,
|
||||||
&link.source);
|
&klink_desc.source);
|
||||||
media_device_kpad_to_upad(ent_link->sink,
|
media_device_kpad_to_upad(link->sink,
|
||||||
&link.sink);
|
&klink_desc.sink);
|
||||||
link.flags = ent_link->flags;
|
klink_desc.flags = link->flags;
|
||||||
if (copy_to_user(ulink, &link, sizeof(*ulink)))
|
if (copy_to_user(ulink_desc, &klink_desc,
|
||||||
|
sizeof(*ulink_desc)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
ulink++;
|
ulink_desc++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue