Skip to content

Commit

Permalink
misc: mic: Use PTR_ERR_OR_ZERO rather than its implementation
Browse files Browse the repository at this point in the history
PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to
use it directly. hence just replace it.

Signed-off-by: zhong jiang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
xiongzhongjiang authored and gregkh committed Sep 10, 2019
1 parent 9b4a66f commit 16a0f68
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/misc/mic/scif/scif_epd.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ 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)
Expand Down

0 comments on commit 16a0f68

Please sign in to comment.