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>
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)) {
return ERR_PTR(-ENODEV);
if (IS_ERR(buffer))
- return ERR_PTR(PTR_ERR(buffer));
+ return ERR_CAST(buffer);
handle = ion_handle_create(client, buffer);
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) {