]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: nvmap: remove support for Deprecated GET_ID/FROM_ID ioctl's
authorManeet Singh <mmaneetsingh@nvidia.com>
Fri, 12 Sep 2014 03:12:33 +0000 (20:12 -0700)
committerWinnie Hsu <whsu@nvidia.com>
Fri, 26 Sep 2014 17:25:15 +0000 (10:25 -0700)
Remove support and add warning message for deprecated IOCTL's -
NVMAP_IOC_FROM_ID and NVMAP_IOC_GET_ID. These ioctl calls
are deprecated by corresponding FD ioctl calls.

Bug 1553082

Change-Id: I3cd531422293f19496687f346692fa91ebe58a40
Signed-off-by: Maneet Singh <mmaneetsingh@nvidia.com>
Reviewed-on: http://git-master/r/498045
(cherry picked from commit 420dce0a99231453ebbd091f110d0de816e4885e)
Reviewed-on: http://git-master/r/538987
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
drivers/video/tegra/nvmap/nvmap_dev.c
drivers/video/tegra/nvmap/nvmap_ioctl.c
drivers/video/tegra/nvmap/nvmap_ioctl.h

index 1c27e36c190dff8977d2549295fb10d0deddbd0f..d90fc4a417baf7d519ad5d1746e897726185a092 100644 (file)
@@ -516,14 +516,14 @@ static long nvmap_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 
        switch (cmd) {
        case NVMAP_IOC_CREATE:
-       case NVMAP_IOC_FROM_ID:
        case NVMAP_IOC_FROM_FD:
                err = nvmap_ioctl_create(filp, cmd, uarg);
                break;
 
+       case NVMAP_IOC_FROM_ID:
        case NVMAP_IOC_GET_ID:
-               err = nvmap_ioctl_getid(filp, uarg);
-               break;
+               pr_warn_once("nvmap: unsupported FROM_ID/GET_ID IOCTLs used.\n");
+               return -ENOTTY;
 
        case NVMAP_IOC_GET_FD:
                err = nvmap_ioctl_getfd(filp, uarg);
index a71322b76f238ee07732a14580ce0ce268edffa1..850afd1ff43772ad8a0fec593434f0f5159ba7de 100644 (file)
@@ -60,34 +60,6 @@ struct nvmap_handle *unmarshal_user_handle(__u32 handle)
        return 0;
 }
 
-/*
- * marshal_id/unmarshal_id are for get_id/handle_from_id.
- * These are added to support using Fd's for handle.
- */
-#ifdef CONFIG_ARM64
-static __u32 marshal_id(struct nvmap_handle *handle)
-{
-       return (__u32)((uintptr_t)handle >> 2);
-}
-
-static struct nvmap_handle *unmarshal_id(__u32 id)
-{
-       uintptr_t h = ((id << 2) | PAGE_OFFSET);
-
-       return (struct nvmap_handle *)h;
-}
-#else
-static __u32 marshal_id(struct nvmap_handle *handle)
-{
-       return (uintptr_t)handle;
-}
-
-static struct nvmap_handle *unmarshal_id(__u32 id)
-{
-       return (struct nvmap_handle *)id;
-}
-#endif
-
 struct nvmap_handle *__nvmap_ref_to_id(struct nvmap_handle_ref *ref)
 {
        if (!virt_addr_valid(ref))
@@ -233,24 +205,6 @@ out:
        return err;
 }
 
-int nvmap_ioctl_getid(struct file *filp, void __user *arg)
-{
-       struct nvmap_create_handle op;
-       struct nvmap_handle *h = NULL;
-
-       if (copy_from_user(&op, arg, sizeof(op)))
-               return -EFAULT;
-
-       h = unmarshal_user_handle(op.handle);
-       if (!h)
-               return -EINVAL;
-
-       op.id = marshal_id(h);
-       nvmap_handle_put(h);
-
-       return copy_to_user(arg, &op, sizeof(op)) ? -EFAULT : 0;
-}
-
 static int nvmap_share_release(struct inode *inode, struct file *file)
 {
        struct nvmap_handle *h = file->private_data;
@@ -391,8 +345,6 @@ int nvmap_ioctl_create(struct file *filp, unsigned int cmd, void __user *arg)
                ref = nvmap_create_handle(client, PAGE_ALIGN(op.size));
                if (!IS_ERR(ref))
                        ref->handle->orig_size = op.size;
-       } else if (cmd == NVMAP_IOC_FROM_ID) {
-               ref = nvmap_duplicate_handle(client, unmarshal_id(op.id), 0);
        } else if (cmd == NVMAP_IOC_FROM_FD) {
                ref = nvmap_create_handle_from_fd(client, op.fd);
        } else {
index a0379b064c2f92a71a54fa6e29dddc22bc8ac54d..6c051fe64579e5a9ac80e13a6859587014d45e56 100644 (file)
@@ -30,8 +30,6 @@ int nvmap_ioctl_pinop(struct file *filp, bool is_pin, void __user *arg,
 
 int nvmap_ioctl_get_param(struct file *filp, void __user *arg, bool is32);
 
-int nvmap_ioctl_getid(struct file *filp, void __user *arg);
-
 int nvmap_ioctl_getfd(struct file *filp, void __user *arg);
 
 int nvmap_ioctl_alloc(struct file *filp, void __user *arg);