From patchwork Tue Jun 14 05:25:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 9174981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2886560772 for ; Tue, 14 Jun 2016 05:27:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D32627DF9 for ; Tue, 14 Jun 2016 05:27:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11F39281DB; Tue, 14 Jun 2016 05:27:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4CC028047 for ; Tue, 14 Jun 2016 05:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750751AbcFNF1E (ORCPT ); Tue, 14 Jun 2016 01:27:04 -0400 Received: from mga03.intel.com ([134.134.136.65]:37854 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbcFNF1C (ORCPT ); Tue, 14 Jun 2016 01:27:02 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 13 Jun 2016 22:27:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,470,1459839600"; d="scan'208";a="1001398318" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga002.fm.intel.com with ESMTP; 13 Jun 2016 22:27:01 -0700 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1bCgsH-000DPD-MO; Tue, 14 Jun 2016 13:26:53 +0800 Date: Tue, 14 Jun 2016 13:25:41 +0800 From: kbuild test robot Cc: kbuild-all@01.org, linux-rdma@vger.kernel.org, target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, Nicholas Bellinger Subject: [PATCH] nvmet/rdma: fix ptr_ret.cocci warnings Message-ID: <20160614052541.GA19284@lkp-nex05> References: <201606141338.n0GrvsGu%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201606141338.n0GrvsGu%fengguang.wu@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false To: unlisted-recipients:; (no To-header on input) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/nvme/target/rdma.c:1441: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 --- rdma.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/nvme/target/rdma.c +++ b/drivers/nvme/target/rdma.c @@ -1438,10 +1438,7 @@ static int nvmet_rdma_add_port(struct nv mutex_unlock(&nvmet_rdma_ports_mutex); rdma_port = nvmet_rdma_listen_cmid(pb); - if (IS_ERR(rdma_port)) - return PTR_ERR(rdma_port); - - return 0; + return PTR_ERR_OR_ZERO(rdma_port); } static void nvmet_rdma_remove_port(struct nvmet_port_binding *pb)