Commit 464a5028 authored by Iulia Manda's avatar Iulia Manda Committed by Peter P Waskiewicz Jr

staging: android: ion: Use ERR_CAST instead of ERR_PTR

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: default avatarIulia Manda <iulia.manda21@gmail.com>
Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
parent 164ad86d
...@@ -215,7 +215,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, ...@@ -215,7 +215,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
if (IS_ERR(table)) { if (IS_ERR(table)) {
heap->ops->free(buffer); heap->ops->free(buffer);
kfree(buffer); kfree(buffer);
return ERR_PTR(PTR_ERR(table)); return ERR_CAST(table);
} }
buffer->sg_table = table; buffer->sg_table = table;
if (ion_buffer_fault_user_mappings(buffer)) { if (ion_buffer_fault_user_mappings(buffer)) {
...@@ -508,7 +508,7 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len, ...@@ -508,7 +508,7 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
if (IS_ERR(buffer)) if (IS_ERR(buffer))
return ERR_PTR(PTR_ERR(buffer)); return ERR_CAST(buffer);
handle = ion_handle_create(client, buffer); handle = ion_handle_create(client, buffer);
...@@ -1147,7 +1147,7 @@ struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd) ...@@ -1147,7 +1147,7 @@ struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd)
dmabuf = dma_buf_get(fd); dmabuf = dma_buf_get(fd);
if (IS_ERR(dmabuf)) if (IS_ERR(dmabuf))
return ERR_PTR(PTR_ERR(dmabuf)); return ERR_CAST(dmabuf);
/* if this memory came from ion */ /* if this memory came from ion */
if (dmabuf->ops != &dma_buf_ops) { if (dmabuf->ops != &dma_buf_ops) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment