staging: android: ion: Use ERR_CAST instead of ERR_PTR
authorIulia Manda <iulia.manda21@gmail.com>
Tue, 11 Mar 2014 18:14:36 +0000 (20:14 +0200)
committerPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Thu, 13 Mar 2014 23:34:02 +0000 (16:34 -0700)
Fix the following coccinelle warnings in ion.c:
drivers/staging/android/ion/ion.c:511:9-16: WARNING: ERR_CAST can be used with buffer
drivers/staging/android/ion/ion.c:218:9-16: WARNING: ERR_CAST can be used with table
drivers/staging/android/ion/ion.c:1150:9-16: WARNING: ERR_CAST can be used with dmabuf

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
drivers/staging/android/ion/ion.c

index b38f5f70530b1ed9e7e43514bc7bbce83e364392..3d5bf1472236c15e68994462ea44ef2b7fc0cf7e 100644 (file)
@@ -215,7 +215,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
        if (IS_ERR(table)) {
                heap->ops->free(buffer);
                kfree(buffer);
-               return ERR_PTR(PTR_ERR(table));
+               return ERR_CAST(table);
        }
        buffer->sg_table = table;
        if (ion_buffer_fault_user_mappings(buffer)) {
@@ -508,7 +508,7 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
                return ERR_PTR(-ENODEV);
 
        if (IS_ERR(buffer))
-               return ERR_PTR(PTR_ERR(buffer));
+               return ERR_CAST(buffer);
 
        handle = ion_handle_create(client, buffer);
 
@@ -1147,7 +1147,7 @@ struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd)
 
        dmabuf = dma_buf_get(fd);
        if (IS_ERR(dmabuf))
-               return ERR_PTR(PTR_ERR(dmabuf));
+               return ERR_CAST(dmabuf);
        /* if this memory came from ion */
 
        if (dmabuf->ops != &dma_buf_ops) {