From patchwork Wed May 6 07:54:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zou Wei X-Patchwork-Id: 11530535 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13089139F for ; Wed, 6 May 2020 07:48:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05D8920747 for ; Wed, 6 May 2020 07:48:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728412AbgEFHsU (ORCPT ); Wed, 6 May 2020 03:48:20 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:50036 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728335AbgEFHsU (ORCPT ); Wed, 6 May 2020 03:48:20 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EDDA8548B739D91516FA; Wed, 6 May 2020 15:48:17 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Wed, 6 May 2020 15:48:10 +0800 From: Samuel Zou To: , , , CC: , , Samuel Zou Subject: [PATCH -next] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code Date: Wed, 6 May 2020 15:54:10 +0800 Message-ID: <1588751650-37186-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 X-Originating-IP: [10.175.103.112] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Fixes coccicheck warning: drivers/scsi/qla2xxx/tcm_qla2xxx.c:1488:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: Samuel Zou --- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 1f0a185..7c4157e 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1485,10 +1485,8 @@ static int tcm_qla2xxx_check_initiator_node_acl( sizeof(struct qla_tgt_cmd), TARGET_PROT_ALL, port_name, qlat_sess, tcm_qla2xxx_session_cb); - if (IS_ERR(se_sess)) - return PTR_ERR(se_sess); - return 0; + return PTR_ERR_OR_ZERO(se_sess); } static void tcm_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id,