[PATCH] sync_file: fix ptr_ret.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux