]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: nvmap: cleanup redundant functions
authorManeet Singh <mmaneetsingh@nvidia.com>
Fri, 12 Sep 2014 00:53:42 +0000 (17:53 -0700)
committerMitch Luban <mluban@nvidia.com>
Tue, 14 Oct 2014 22:02:06 +0000 (15:02 -0700)
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>
drivers/video/tegra/nvmap/nvmap_dmabuf.c
drivers/video/tegra/nvmap/nvmap_handle.c
drivers/video/tegra/nvmap/nvmap_ioctl.c
drivers/video/tegra/nvmap/nvmap_priv.h

index bae5f381938054c26a3c38e3e6d558a248332cd4..2a1659467045fc7b0003556151ad16c1bb267dde 100644 (file)
@@ -710,7 +710,7 @@ int nvmap_ioctl_share_dmabuf(struct file *filp, void __user *arg)
        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;
 
index 0312f6d436130e81c7025a52430ed2bb58983091..da26f985403f8813a84bbea49b0a59d6d58a0bc9 100644 (file)
@@ -464,7 +464,7 @@ EXPORT_SYMBOL(nvmap_free_handle);
 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,
index 845b04a53b0a6bc0df15bbc7abd997dfa161226f..2eafb680e8f780ba3a82299d84ba0cd16f325f06 100644 (file)
@@ -46,26 +46,16 @@ static ssize_t rw_handle(struct nvmap_client *client, struct nvmap_handle *h,
                         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;
 
-       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;
 }
 
-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.
index 486b64f32751e1ef636ad9868bfd16e73d8541d1..744238875c937c381b522453bbdae23f5e81fdc7 100644 (file)
@@ -430,7 +430,7 @@ struct nvmap_client *nvmap_client_get(struct nvmap_client *client);
 
 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)
 {