From f6b9afa5944aa2fab077a34c25d57bde46d1f389 Mon Sep 17 00:00:00 2001 From: Maneet Singh Date: Thu, 11 Sep 2014 17:53:42 -0700 Subject: [PATCH] video: tegra: nvmap: cleanup redundant functions 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 Reviewed-on: http://git-master/r/498103 (cherry picked from commit 4880b6c2bdf5b10e4a71b5b79e7878343b9e7e3b) Reviewed-on: http://git-master/r/556842 Reviewed-by: Mitch Luban Tested-by: Mitch Luban --- drivers/video/tegra/nvmap/nvmap_dmabuf.c | 2 +- drivers/video/tegra/nvmap/nvmap_handle.c | 2 +- drivers/video/tegra/nvmap/nvmap_ioctl.c | 14 ++------------ drivers/video/tegra/nvmap/nvmap_priv.h | 2 +- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/video/tegra/nvmap/nvmap_dmabuf.c b/drivers/video/tegra/nvmap/nvmap_dmabuf.c index bae5f381938..2a165946704 100644 --- a/drivers/video/tegra/nvmap/nvmap_dmabuf.c +++ b/drivers/video/tegra/nvmap/nvmap_dmabuf.c @@ -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; diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index 0312f6d4361..da26f985403 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -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, diff --git a/drivers/video/tegra/nvmap/nvmap_ioctl.c b/drivers/video/tegra/nvmap/nvmap_ioctl.c index 845b04a53b0..2eafb680e8f 100644 --- a/drivers/video/tegra/nvmap/nvmap_ioctl.c +++ b/drivers/video/tegra/nvmap/nvmap_ioctl.c @@ -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. diff --git a/drivers/video/tegra/nvmap/nvmap_priv.h b/drivers/video/tegra/nvmap/nvmap_priv.h index 486b64f3275..744238875c9 100644 --- a/drivers/video/tegra/nvmap/nvmap_priv.h +++ b/drivers/video/tegra/nvmap/nvmap_priv.h @@ -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) { -- 2.39.2