Removed redundant function unmarshal_user_id() and replaced it with
unmarshal_user_handle() which it internally calls without any other
changes.
Bug
1553082
Change-Id: I7d998966c593f11a3322b0503ef11311fc1ae5e7
Signed-off-by: Maneet Singh <mmaneetsingh@nvidia.com>
Reviewed-on: http://git-master/r/498103
(cherry picked from commit
4880b6c2bdf5b10e4a71b5b79e7878343b9e7e3b)
Reviewed-on: http://git-master/r/556842
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Tested-by: Mitch Luban <mluban@nvidia.com>
if (copy_from_user(&op, (void __user *)arg, sizeof(op)))
return -EFAULT;
if (copy_from_user(&op, (void __user *)arg, sizeof(op)))
return -EFAULT;
- handle = unmarshal_user_id(op.id);
+ handle = unmarshal_user_handle(op.id);
if (!handle)
return -EINVAL;
if (!handle)
return -EINVAL;
void nvmap_free_handle_user_id(struct nvmap_client *client,
unsigned long user_id)
{
void nvmap_free_handle_user_id(struct nvmap_client *client,
unsigned long user_id)
{
- nvmap_free_handle(client, unmarshal_user_id(user_id));
+ nvmap_free_handle(client, unmarshal_user_handle(user_id));
}
static void add_handle_ref(struct nvmap_client *client,
}
static void add_handle_ref(struct nvmap_client *client,
unsigned long sys_stride, unsigned long elem_size,
unsigned long count);
unsigned long sys_stride, unsigned long elem_size,
unsigned long count);
-static struct nvmap_handle *fd_to_handle_id(int handle)
+struct nvmap_handle *unmarshal_user_handle(__u32 handle)
{
struct nvmap_handle *h;
{
struct nvmap_handle *h;
- h = nvmap_get_id_from_dmabuf_fd(NULL, handle);
+ h = nvmap_get_id_from_dmabuf_fd(NULL, (int)handle);
if (!IS_ERR(h))
return h;
return 0;
}
if (!IS_ERR(h))
return h;
return 0;
}
-static struct nvmap_handle *unmarshal_user_handle(__u32 handle)
-{
- return fd_to_handle_id((int)handle);
-}
-
-struct nvmap_handle *unmarshal_user_id(u32 id)
-{
- return unmarshal_user_handle(id);
-}
-
/*
* marshal_id/unmarshal_id are for get_id/handle_from_id.
* These are added to support using Fd's for handle.
/*
* marshal_id/unmarshal_id are for get_id/handle_from_id.
* These are added to support using Fd's for handle.
void nvmap_client_put(struct nvmap_client *c);
void nvmap_client_put(struct nvmap_client *c);
-struct nvmap_handle *unmarshal_user_id(u32 id);
+struct nvmap_handle *unmarshal_user_handle(__u32 handle);
static inline void nvmap_flush_tlb_kernel_page(unsigned long kaddr)
{
static inline void nvmap_flush_tlb_kernel_page(unsigned long kaddr)
{