From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09CD2C83F12 for ; Tue, 29 Aug 2023 14:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236312AbjH2OEJ (ORCPT ); Tue, 29 Aug 2023 10:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236693AbjH2ODh (ORCPT ); Tue, 29 Aug 2023 10:03:37 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FAA5114; Tue, 29 Aug 2023 07:03:24 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RZpyj3fHJz6HJjy; Tue, 29 Aug 2023 22:02:21 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 29 Aug 2023 15:03:21 +0100 Date: Tue, 29 Aug 2023 15:03:20 +0100 From: Jonathan Cameron To: Ira Weiny CC: Dan Williams , Navneet Singh , Fan Ni , Davidlohr Bueso , Dave Jiang , Alison Schofield , Vishal Verma , , Subject: Re: [PATCH RFC v2 01/18] cxl/hdm: Debug, use decoder name function Message-ID: <20230829150320.00007f08@Huawei.com> In-Reply-To: <20230604-dcd-type2-upstream-v2-1-f740c47e7916@intel.com> References: <20230604-dcd-type2-upstream-v2-0-f740c47e7916@intel.com> <20230604-dcd-type2-upstream-v2-1-f740c47e7916@intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Aug 2023 22:20:52 -0700 Ira Weiny wrote: > The decoder enum has a name conversion function defined now. > > Use that instead of open coding. > > Suggested-by: Navneet Singh > Signed-off-by: Ira Weiny > Perhaps pull this one out so it can go upstream before the rest are ready, or could be picked up from here. Whilst we probably won't see the other decoder modes in here, there is no reason why anyone reading the code should have to figure that out. As such much better to use the more generic function. Reviewed-by: Jonathan Cameron > --- > Changes for v2: > [iweiny: new patch, split out] > --- > drivers/cxl/core/hdm.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c > index b01a77b67511..a254f79dd4e8 100644 > --- a/drivers/cxl/core/hdm.c > +++ b/drivers/cxl/core/hdm.c > @@ -550,8 +550,7 @@ int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long long size) > > if (size > avail) { > dev_dbg(dev, "%pa exceeds available %s capacity: %pa\n", &size, > - cxled->mode == CXL_DECODER_RAM ? "ram" : "pmem", > - &avail); > + cxl_decoder_mode_name(cxled->mode), &avail); > rc = -ENOSPC; > goto out; > } >