Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1736222pxb; Sat, 16 Oct 2021 18:40:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlWqdjYmgsyjTYY0KsK7/NL4Qu7mXzKFDbPdsKXdUU0fRfqM2cV2zLyxdabzW0aslQk7a6 X-Received: by 2002:a05:6402:270b:: with SMTP id y11mr31436558edd.116.1634434826792; Sat, 16 Oct 2021 18:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634434826; cv=none; d=google.com; s=arc-20160816; b=JaHszyHTCRWqh6C2/E9o02q+/OJfn+b/556MJHFJ9OGtvoASyk7PlJ41HkqoD5f+bR GbPKT4SqBF0f1Ove03bJQfa5S4ImUkQSD6Pdblwb4hWBhVijTVxJ+2MuQFUOOoEs0vH6 D20Y8AMdOd3nt/L6H1pDb9ZXUjOmp8jQ2HmFi5IWEVEYipbihwbRLau1sbE0tMEkkhIF xd8rAXNXkxXqQvfpC+3e4A6BEJ4pLi96n2xPDiEwFmK7pN2GeFrBN0EjOZZe+nUH52/V JMFjuCcsswtUyiYKycUhNEc1Da29SYdpHCHXeIT4BClN6LGDsU2bMRJP2W/BagKmaUKV 7IUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Xs+FT3knRYHi6OPFPa3xa4oe3F0n0tHoMsvvhSpn75c=; b=0pQO5UoKlZUW2Fmkdrm8tXQmH6g4pyhX2nN3HjKgZSa/Fqa7xRZss/fiQ3+rIgKAc2 mShmGMtE4fC1WyLymYtcX+qV2hpFTXzWXeq2r81lN0jzB4m4ufe2Hdr/3AyBZRiqfZUf zLcprcAPor31DqGzEnVCJKhXi/rh315N0Adunaw3ZhybzntjrjJtRELbVDQ39LtyTTbH ZpSv9co/F9rpMy8680FeXpCP3RHGVc2996f8AanPQhzENhuor0+9rAtsIaQAsW+LiaT1 xq7l2JrCC2n3UYBUQsJStNCwGm27IwUb2kqgoPcPCkecUg0JFhI82tOCCrnU94ZQ62m7 hUkw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w15si13683491edl.93.2021.10.16.18.40.02; Sat, 16 Oct 2021 18:40:26 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241181AbhJOQRR (ORCPT + 99 others); Fri, 15 Oct 2021 12:17:17 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3984 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237297AbhJOQRR (ORCPT ); Fri, 15 Oct 2021 12:17:17 -0400 Received: from fraeml710-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4HWB9l0ss6z67RS4; Sat, 16 Oct 2021 00:12:11 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml710-chm.china.huawei.com (10.206.15.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 15 Oct 2021 18:15:08 +0200 Received: from localhost (10.202.226.41) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 15 Oct 2021 17:15:08 +0100 Date: Fri, 15 Oct 2021 17:15:07 +0100 From: Jonathan Cameron To: Dan Williams CC: , , Ira Weiny , , , Subject: Re: [PATCH v3 03/10] cxl/pci: Fix NULL vs ERR_PTR confusion Message-ID: <20211015171507.000010dd@Huawei.com> In-Reply-To: <163379785305.692348.7804260538462033304.stgit@dwillia2-desk3.amr.corp.intel.com> References: <163379783658.692348.16064992154261275220.stgit@dwillia2-desk3.amr.corp.intel.com> <163379785305.692348.7804260538462033304.stgit@dwillia2-desk3.amr.corp.intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.41] X-ClientProxiedBy: lhreml727-chm.china.huawei.com (10.201.108.78) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 9 Oct 2021 09:44:13 -0700 Dan Williams wrote: > cxl_pci_map_regblock() may return an ERR_PTR(), but cxl_pci_setup_regs() > is only prepared for NULL as the error case. > What's the logic behind doing this rather than adjusting the call site to check for an error pointer? Either approach is fine as far as I'm concerned though so this is really just a request for a bit more info in this patch description. FWIW Reviewed-by: Jonathan Cameron > Fixes: f8a7e8c29be8 ("cxl/pci: Reserve all device regions at once") > Cc: > Cc: Jonathan Cameron > Cc: Ira Weiny > Signed-off-by: Dan Williams > --- > drivers/cxl/pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c > index ccc7c2573ddc..9c178002d49e 100644 > --- a/drivers/cxl/pci.c > +++ b/drivers/cxl/pci.c > @@ -317,7 +317,7 @@ static void __iomem *cxl_pci_map_regblock(struct cxl_mem *cxlm, > if (pci_resource_len(pdev, bar) < offset) { > dev_err(dev, "BAR%d: %pr: too small (offset: %#llx)\n", bar, > &pdev->resource[bar], (unsigned long long)offset); > - return IOMEM_ERR_PTR(-ENXIO); > + return NULL; > } > > addr = pci_iomap(pdev, bar, 0); >