Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp174989ybl; Wed, 22 Jan 2020 18:46:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzjesvcA/ZYNeYxaSETp21X39m7qQQFe3roR3uJNqzuEgmqnmAJX5k4f715/MuevapZMjvq X-Received: by 2002:aca:48cd:: with SMTP id v196mr9369615oia.102.1579747614698; Wed, 22 Jan 2020 18:46:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579747614; cv=none; d=google.com; s=arc-20160816; b=NlaNBiWzGJeWt29drhzfdGcKPy++oju1+b3/lAXINbFnvhjPmbmBthkQ4qMabZ4Vwn oi+eruLZ13CEJaTWqjrqJ+Pnh5oXSFWci4ttAIG++AzZ2wcA2rVYlSj7OSh3+cUppRPz 1wScehtbEHKed6rI/1m5yLm7R9aWFmgrBfUqbu1qVwP0vVQrrcZrb1PE7w+5AtMhOpDN LoaC22VXZ2hf17Uu1tNPmtSaCLNM0CZOp5uFpmL0ubmqVujJLImtDcKF/NnfSlDsNLzz jhxxLtc0xFV5gDw0i5P8YXYl2a+hXDqN69JXjVFIIOonLIvwnKkbsN+s3CIBnmOGYs1i 0RVg== 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=0bTKL1nEMmiTu3DN8/wNxHjP2cGwCMK4tEMnT3FtOBI=; b=o08oEo7jHVa8HddhJvi95dISfxdFU3w8Ckez2W7isglu27yJhuNEBWwaIxGEf0VUtk mA0FdbBKkMNdOfEgB9upVotfUq05qCMs+LR0vlRrMkEsUt/seO7tbs/STKTbsIHbcwm8 EI0vEoVfLr4R12T6RCChU/mIu0tKE3gZUHlurEcav39MRnUDKZQqeGL3xXteGE1EpNC4 tHRFoHcoM9UVCrMm16mejeIS9euWH29EDB41iIYSgYG8hkDKDY60SDf7kHolfFpsObgV qHf2yZQVkCOl9H8iUg7lRPJ46RX5uFQ9K/VFTjvy4JAniX7Zt+8GyS5/0L72z7PoaIVN rFFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si368198otr.293.2020.01.22.18.46.42; Wed, 22 Jan 2020 18:46:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726099AbgAWCpq (ORCPT + 99 others); Wed, 22 Jan 2020 21:45:46 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:54274 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbgAWCpq (ORCPT ); Wed, 22 Jan 2020 21:45:46 -0500 Received: by mail-pj1-f66.google.com with SMTP id kx11so483823pjb.4; Wed, 22 Jan 2020 18:45:45 -0800 (PST) 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=0bTKL1nEMmiTu3DN8/wNxHjP2cGwCMK4tEMnT3FtOBI=; b=s0kMqxltPtbhmFm/nMEveMzjTQTXXwFp9+LnB3QUWDEvFzbWzbZzuR/zujwHd1iGJf /f+qJAOwU3neV9/nKKnhKxUJpCboxtrXiMWmo+6V1effVbe7gOj4cXuK1j3LpEgBi+eg ik4qeMMPdjeuhmPxXT1zPOKISKKNsEsFwN4PX6tZOVK/iRY5eHm2oauO+drPYv1LcREs qiTt7O7/RY1+dtgAL7i8mivf1/q6QglIatTUEIIuUQT/GVMndd2EYAsnZgL2c/PJxiPs HK3gSRgwmtgvqxyVzCh5iiWgDkn64uatbAGDoR02NmRHafTut4wF5QiTBYrkerULJdzN DOGg== X-Gm-Message-State: APjAAAV5hg0+zlTExqPqgVzpaNHnPFsQLFb166ydy72IDrVNh1oRPhpp z/p+13Uej4r+HS+/9rssJrlI9Pyb X-Received: by 2002:a17:90a:fa10:: with SMTP id cm16mr1916091pjb.129.1579747545094; Wed, 22 Jan 2020 18:45:45 -0800 (PST) Received: from ?IPv6:2601:647:4000:d7:d957:4568:237a:bc62? ([2601:647:4000:d7:d957:4568:237a:bc62]) by smtp.gmail.com with ESMTPSA id b1sm288408pfp.44.2020.01.22.18.45.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jan 2020 18:45:44 -0800 (PST) Subject: Re: [PATCH -next] scsi: qla2xxx: use PTR_ERR_OR_ZERO() to simplify code To: Chen Zhou , hmadhani@marvell.com, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200122101812.94816-1-chenzhou10@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 3SI5kCPSsygD6wKnbRsv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By4SKGhmzwH87uXxbTJAUxiWIi1np0z3/RDnoVyfmfbbL1DY7zf2hYXLLzsJR mSsED/1nlJ9Oq5fALdNEPgDyPUerqHxcmIub+pF0AzJoYHK5punqpqfGmqPbjxrJLPJfHVKy goMj5DlBMoYqEgpbwdUYkH6QdizJJCur4icy8GUNbisFYABeoJ91pnD4IGei3MTdvINSZI5e Message-ID: <697e27b4-a531-3670-0618-f5dc58a8608b@acm.org> Date: Wed, 22 Jan 2020 18:45:43 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200122101812.94816-1-chenzhou10@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-01-22 02:18, Chen Zhou wrote: > PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR, just use > PTR_ERR_OR_ZERO directly. > > Signed-off-by: Chen Zhou > --- > 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 abe7f79..719d53d 100644 > --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c > +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > @@ -1462,10 +1462,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); > } Is this a useful change? My personal opinion is that the current implementation (without this patch) is easier to read. Thanks, Bart.