From: Iulia Manda Date: Tue, 11 Mar 2014 18:14:36 +0000 (+0200) Subject: staging: android: ion: Use ERR_CAST instead of ERR_PTR X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=464a5028eadef63e4b84e834eaeb782b537bf513;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Iulia Manda Acked-by: Paul E. McKenney Signed-off-by: Peter P Waskiewicz Jr --- diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index b38f5f70530b..3d5bf1472236 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -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) {