From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753327AbdK1PTd (ORCPT ); Tue, 28 Nov 2017 10:19:33 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36391 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752187AbdK1PTb (ORCPT ); Tue, 28 Nov 2017 10:19:31 -0500 X-Google-Smtp-Source: AGs4zMbp3RBhFZqgRESw/3OqkCmdrPCgx6vmWqrvDAT85zti/xNZh2m5rhoyGPYej2jXi2WDW1m8yA== From: Vasyl Gomonovych To: sudeep.dutt@intel.com, ashutosh.dixit@intel.com, linux-kernel@vger.kernel.org Cc: gomonovych@gmail.com Subject: [PATCH] misc: mic: Use PTR_ERR_OR_ZERO() Date: Tue, 28 Nov 2017 16:19:21 +0100 Message-Id: <1511882361-2413-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix ptr_ret.cocci warnings: drivers/misc/mic/scif/scif_epd.h:168: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: Vasyl Gomonovych --- 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 1771d7a9b8d0..8dad98edeb56 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) -- 1.9.1