Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp238645ybj; Wed, 6 May 2020 16:17:18 -0700 (PDT) X-Google-Smtp-Source: APiQypIK/F9WTYgMWNdVnzDyiOrM4XpA1miC8iZA08JNMm5yUy7actbTVGscOdh7OXXMOiN5eUzS X-Received: by 2002:a17:906:a3ca:: with SMTP id ca10mr9902180ejb.298.1588807037815; Wed, 06 May 2020 16:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588807037; cv=none; d=google.com; s=arc-20160816; b=v2oT8jbePWln875gMq/cd066A4IPxUqsmSahiGmlVpSxCkwTqLYjFVBMKKCer72CKT h7EBpw65sByiQs8svv+u0jUvlfGHO0qh1CUF0mr8VfF0O8yAb0HY/ztflpFAGDPwDn5B SxqCc4nmUzmovF5Mq0ictrYhhXd1LqicrG/Ad1DvENJEy/FB+CJ3IbZAynILfJaiYG8M xR1fwq5xY9wTKuoCS2+hRTRldSTVibZuzyzzgb/KoJat7MNI1qC9uA5tex95xCVSfOzL dXOinC1UltaHvVkV19qa/xPWF5/D4LFDVYM75G88lk7oEZDPzkeqnkGpjDrbdVIxxtiz f1Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=p8vqcBfi44I5OkhEhqufSEM+gjE4sBS2tKiTaMtMmIg=; b=AgRzHi0Erxny3l3vjtsmMdXiYredvjMy0Kjg281cIdWSUQYpxk3X8SyQiZPmMVzCPr JXvIhIipgZmM2voDchbDoDk7/BZvVNKagqnjVIwsNZT0ozPDmhahcEiZ1sEvefSyrNUI En5SI7CNAFBI6zCgX7/0VKKBbD7tnxrbTnDs+ZSEIfvhZvosPrCTIT/EiF+u5K1rIn2k jQ22+3H9MF7ByUIt8FIanThIvXhrzSbYcDP74Lus+Gx6xPz5bC99Gm11DouY501gbMHS I81j4dYDYYT2AVhSgQxO1hXs5zDqRJ8hIUJkMmHotDieACbwwzDRubiXxbdbidwx4l9X 3OLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c2si2207139ejd.263.2020.05.06.16.16.54; Wed, 06 May 2020 16:17:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729800AbgEFPmS (ORCPT + 99 others); Wed, 6 May 2020 11:42:18 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46896 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729148AbgEFPmS (ORCPT ); Wed, 6 May 2020 11:42:18 -0400 Received: by mail-pg1-f194.google.com with SMTP id q124so933677pgq.13; Wed, 06 May 2020 08:42:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=p8vqcBfi44I5OkhEhqufSEM+gjE4sBS2tKiTaMtMmIg=; b=l6dtqCaxNPJ3b85Fwb9MsTUMECg8FOZ9nmMFDey2UjSPnXAg3cmSbG+21DxUN8LX/J Pzcdt+X4CBtSIcnDBHhxmwowzPO2iRbqOzEdODtp/LO0YUjRlJvw64pX/O1K2ws20AmC bJdIrAZlXLOnW7r3pWllTU/Sn1eFCjAgeZSzNO+n/ZDof953JorRXL4Kz7L2hbBDKZRD ZEj65/Gy1ZjC8Bk9qL2IbSvtwm9MnXRtzuzC1uS2s0XDsb1ynb9xvy5MfJLWUIs0YyTt aSjzje1rrhybcLRrot4pRa8+4GrMQjUwYAOzE6Wi+H2jwWHvS8I+B2ZB87tmeTnN+5F7 U8Cg== X-Gm-Message-State: AGi0PuYbYopkUFsuLLjQrjfQlPKiE07jObXf6Nf9SDhqCFEhqn8tawLe LIm293VeICmv1ejClpC73xuKXEJ5uqA= X-Received: by 2002:aa7:8d93:: with SMTP id i19mr8940039pfr.112.1588779736000; Wed, 06 May 2020 08:42:16 -0700 (PDT) Received: from ?IPv6:2601:647:4000:d7:901f:c4d7:864c:c3a5? ([2601:647:4000:d7:901f:c4d7:864c:c3a5]) by smtp.gmail.com with ESMTPSA id gd17sm5157195pjb.21.2020.05.06.08.42.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 May 2020 08:42:14 -0700 (PDT) Subject: Re: [PATCH -next] scsi: qla2xxx: Use PTR_ERR_OR_ZERO() to simplify code To: Samuel Zou , njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <1588751650-37186-1-git-send-email-zou_wei@huawei.com> From: Bart Van Assche Autocrypt: addr=bvanassche@acm.org; prefer-encrypt=mutual; keydata= mQENBFSOu4oBCADcRWxVUvkkvRmmwTwIjIJvZOu6wNm+dz5AF4z0FHW2KNZL3oheO3P8UZWr LQOrCfRcK8e/sIs2Y2D3Lg/SL7qqbMehGEYcJptu6mKkywBfoYbtBkVoJ/jQsi2H0vBiiCOy fmxMHIPcYxaJdXxrOG2UO4B60Y/BzE6OrPDT44w4cZA9DH5xialliWU447Bts8TJNa3lZKS1 AvW1ZklbvJfAJJAwzDih35LxU2fcWbmhPa7EO2DCv/LM1B10GBB/oQB5kvlq4aA2PSIWkqz4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aonKTANYG22y //x8dLe2Fv1By4SKGhmzwH87uXxbTJAUxiWIi1np0z3/RDnoVyfmfbbL1DY7zf2hYXLLzsJR mSsED/1nlJ9Oq5fALdNEPgDyPUerqHxcmIub+pF0AzJoYHK5punqpqfGmqPbjxrJLPJfHVKy goMj5DlBMoYqEgpbwdUYkH6QdizJJCur4icy8GUNbisFYABeoJ91pnD4IGei3MTdvINSZI5e Message-ID: <5693adb3-8f5c-efcc-8e63-38a8311c90b9@acm.org> Date: Wed, 6 May 2020 08:42:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1588751650-37186-1-git-send-email-zou_wei@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-06 00:54, Samuel Zou wrote: > 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); > } Can the Hulk check that verifies where PTR_ERR_OR_ZERO() can be introduced be deactivated? I think this patch makes the code less readable instead of making it more readable. Thanks, Bart.