drivers/dma-buf/sync_file.c:36:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx> --- sync_file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -33,9 +33,7 @@ static int fence_file_init(struct fence_ { fence_file->file = anon_inode_getfile("fence_file", fops, fence_file, 0); - if (IS_ERR(fence_file->file)) - return PTR_ERR(fence_file->file); - return 0; + return PTR_ERR_OR_ZERO(fence_file->file); } static struct sync_file *sync_file_alloc(void) _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel