ion: change ion_user_handle_t definition to int
authorRom Lemarchand <romlem@google.com>
Thu, 24 Oct 2013 02:30:58 +0000 (19:30 -0700)
committerRom Lemarchand <romlem@google.com>
Thu, 24 Oct 2013 20:21:09 +0000 (20:21 +0000)
Turn ion_user_handle_t to int. This change reflects the underlying type
returned by the ion driver.

Change-Id: I40390dae8138327769510525bf62e55877a4b37d
Signed-off-by: Rom Lemarchand <romlem@google.com>
drivers/gpu/ion/ion.c
include/linux/ion.h

index 8fe7d523f7225beee0f29ab435d353435a208ea0..c4d0a487823ee33d76f7dfda9927be08c1273bb3 100644 (file)
@@ -1139,7 +1139,7 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                if (IS_ERR(handle))
                        return PTR_ERR(handle);
 
-               data.handle = (ion_user_handle_t)handle->id;
+               data.handle = handle->id;
 
                if (copy_to_user((void __user *)arg, &data, sizeof(data))) {
                        ion_free(client, handle);
@@ -1156,7 +1156,7 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                                   sizeof(struct ion_handle_data)))
                        return -EFAULT;
                mutex_lock(&client->lock);
-               handle = ion_uhandle_get(client, (int)data.handle);
+               handle = ion_uhandle_get(client, data.handle);
                mutex_unlock(&client->lock);
                if (!handle)
                        return -EINVAL;
@@ -1171,7 +1171,7 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 
                if (copy_from_user(&data, (void __user *)arg, sizeof(data)))
                        return -EFAULT;
-               handle = ion_uhandle_get(client, (int)data.handle);
+               handle = ion_uhandle_get(client, data.handle);
                data.fd = ion_share_dma_buf_fd(client, handle);
                if (copy_to_user((void __user *)arg, &data, sizeof(data)))
                        return -EFAULT;
@@ -1191,7 +1191,7 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                if (IS_ERR(handle))
                        ret = PTR_ERR(handle);
                else
-                       data.handle = (ion_user_handle_t)handle->id;
+                       data.handle = handle->id;
 
                if (copy_to_user((void __user *)arg, &data,
                                 sizeof(struct ion_fd_data)))
index 40ea332ebfa22ce131ae3ef7f3e8d7c7d20771b7..5771f8c3d3ac358a99268c49db95363a48d81100 100644 (file)
@@ -19,8 +19,7 @@
 
 #include <linux/types.h>
 
-struct ion_handle;
-typedef struct ion_handle *ion_user_handle_t;
+typedef int ion_user_handle_t;
 
 /**
  * enum ion_heap_types - list of all possible types of heaps
@@ -65,6 +64,7 @@ enum ion_heap_type {
                                           caches must be managed manually */
 
 #ifdef __KERNEL__
+struct ion_handle;
 struct ion_device;
 struct ion_heap;
 struct ion_mapper;