linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-next] misc: mic: Use PTR_ERR_OR_ZERO
@ 2018-01-23 20:10 Christopher Díaz Riveros
  2018-01-23 21:55 ` Al Viro
  2018-01-24  8:16 ` walter harms
  0 siblings, 2 replies; 5+ messages in thread
From: Christopher Díaz Riveros @ 2018-01-23 20:10 UTC (permalink / raw)
  To: sudeep.dutt, ashutosh.dixit, arnd, gregkh, viro
  Cc: Christopher Díaz Riveros, linux-kernel, kernel-janitors

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

This issue was detected by using the Coccinelle software.

Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
---
 drivers/misc/mic/scif/scif_epd.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/misc/mic/scif/scif_epd.h b/drivers/misc/mic/scif/scif_epd.h
index f39b663da287..b2a835665390 100644
--- a/drivers/misc/mic/scif/scif_epd.h
+++ b/drivers/misc/mic/scif/scif_epd.h
@@ -165,9 +165,7 @@ static inline int scif_verify_epd(struct scif_endpt *ep)
 static inline int scif_anon_inode_getfile(scif_epd_t epd)
 {
 	epd->anon = anon_inode_getfile("scif", &scif_anon_fops, NULL, 0);
-	if (IS_ERR(epd->anon))
-		return PTR_ERR(epd->anon);
-	return 0;
+	return PTR_ERR_OR_ZERO(epd->anon);
 }
 
 static inline void scif_anon_inode_fput(scif_epd_t epd)
-- 
2.16.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH-next] misc: mic: Use PTR_ERR_OR_ZERO
@ 2018-01-23 20:14 Christopher Díaz Riveros
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Díaz Riveros @ 2018-01-23 20:14 UTC (permalink / raw)
  To: sudeep.dutt, ashutosh.dixit, arnd, gregkh, viro
  Cc: linux-kernel, kernel-janitors, Christopher Díaz Riveros

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

This issue was detected by using the Coccinelle software.

Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
---
 drivers/misc/mic/scif/scif_epd.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/misc/mic/scif/scif_epd.h b/drivers/misc/mic/scif/scif_epd.h
index f39b663da287..b2a835665390 100644
--- a/drivers/misc/mic/scif/scif_epd.h
+++ b/drivers/misc/mic/scif/scif_epd.h
@@ -165,9 +165,7 @@ static inline int scif_verify_epd(struct scif_endpt *ep)
 static inline int scif_anon_inode_getfile(scif_epd_t epd)
 {
 	epd->anon = anon_inode_getfile("scif", &scif_anon_fops, NULL, 0);
-	if (IS_ERR(epd->anon))
-		return PTR_ERR(epd->anon);
-	return 0;
+	return PTR_ERR_OR_ZERO(epd->anon);
 }
 
 static inline void scif_anon_inode_fput(scif_epd_t epd)
-- 
2.16.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-27  3:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23 20:10 [PATCH-next] misc: mic: Use PTR_ERR_OR_ZERO Christopher Díaz Riveros
2018-01-23 21:55 ` Al Viro
2018-01-27  3:45   ` Ashutosh Dixit
2018-01-24  8:16 ` walter harms
2018-01-23 20:14 Christopher Díaz Riveros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).