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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59C18C44515 for ; Mon, 20 Jul 2026 22:02:33 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4h3vdM595Gz2xJR; Tue, 21 Jul 2026 08:02:31 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1784584951; cv=none; b=iCA5mKeb8Lx8brmiy7kOBNnkLm+u1x4JyuOzke+rmcnQonZjdSiVT7OUx4RMO38EEevEe5pTYP6ve9pWBy2D2KSoYe90xg19IEvVXdeFpwHkNMH83oLfn8fg9iLh/6I7pSwn61OLKeJh22f5Sqm45Zjm8DSS8quq2MreqlzPHDp2eM7t7jJXrgJqtK6k1aR8jRv8XvU9El4d4G8i4JDwyq4BAuD73909eA3aLNIIehxDZxksluzgU1bDTwDKISzbHOld6VaIfyY6eEhSQWsy9npDYittRl5mtfLK7Kr4XRtGJA5QuI3h9b3Kd+FWRUBA1ajFj3C7aT9rA53/gsxPkQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1784584951; c=relaxed/relaxed; bh=6cs7LhaOrHnB/OaGU/+xy3diNyVqHofixZTfSSyjrGs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=E5nO5ZUO0+S4qvpV3NhDloHLZd+KT7mTrfBeyDGlIefZBJsfne9YukVSI4X9yJKWcTqmT3MC8zlVCiRke23Ncdu1zP+gHGVuAwmJmjXaZ84Ag29Yu/pP5Ag07VWPa5EKQ6Wrsx7NeZKBeWevetJQ68KJ6A/nZqsDQeXCOdtEeuDsV2v/lGp5zXYIefCWKDXPehzbFwH14iSSMp2hmyWJQyL+8iCGPm9A1SecPNhwl4iv5dnqTx5l055WP742x3CCMVWXdbKvPpmLbdG/KpYARI30WGohFemc336Rg2oPD6hXpF/d7wD+QqjBO8NHpoDkpAkaKgl0TgGs3DfRg8tFrw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=a+2U5CnU; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=jic23@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=a+2U5CnU; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=jic23@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4h3vdL0Zr2z2xFc for ; Tue, 21 Jul 2026 08:02:30 +1000 (AEST) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id EEC2943EFE; Mon, 20 Jul 2026 22:02:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47AB61F000E9; Mon, 20 Jul 2026 22:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784584947; bh=6cs7LhaOrHnB/OaGU/+xy3diNyVqHofixZTfSSyjrGs=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=a+2U5CnUbrj+JzvFAXU+vwi4g6TkNykWxDqU1QodrcuosBXdGMdV5IKvLI5ADTTEB ZAXpIVMzHuvIc4ET6+IHyKMbJjYdZFXC/LdVSBIBFTi9ngKoaPF6fyecRUAjO80NHk vv4lQ098TM28m5u8iZzmAy0x/xDaZAO7pvPS0eZnkTnSYFkjOwkYI+JlvoswH0OXSZ pgbNN2KlkFoALigw4h1AbtEpE1WIL8Y0nFBMJUk0w8TEMj4UxvdN+NtSiHRKCWx3Pg TmycMTeyZM1RZEbIULPT/XeBndPmudjGkE5d8RV9gC9oPQQ59hPbdlstiUXLbjK5b6 94RCWGg8Vyi9A== Date: Mon, 20 Jul 2026 23:02:19 +0100 From: Jonathan Cameron To: Terry Bowman Cc: Bjorn Helgaas , Dan Williams , "Dave Jiang" , Ira Weiny , Len Brown , "Rafael J . Wysocki" , Robert Richter , , , , , , , "Alejandro Lucero" , Alison Schofield , Ankit Agrawal , Ard Biesheuvel , "Ben Cheatham" , Borislav Petkov , "Breno Leitao" , Davidlohr Bueso , "Fabio M . De Francesco" , Gregory Price , Hanjun Guo , Jonathan Corbet , Kees Cook , Kuppuswamy Sathyanarayanan , Li Ming , Mahesh J Salgaonkar , Mauro Carvalho Chehab , Oliver O'Halloran , Shiju Jose , Shuah Khan , Shuai Xue , Smita Koralahalli , Tony Luck , Vishal Verma Subject: Re: [PATCH v18 04/13] cxl: Rename find_cxl_port() to find_cxl_port_by_dport() Message-ID: <20260720230219.632420c1@jic23-huawei> In-Reply-To: <20260717222706.3540281-5-terry.bowman@amd.com> References: <20260717222706.3540281-1-terry.bowman@amd.com> <20260717222706.3540281-5-terry.bowman@amd.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 17 Jul 2026 17:26:57 -0500 Terry Bowman wrote: > From: Dan Williams > > find_cxl_port() and find_cxl_port_by_uport() are internal port lookup > functions that search the CXL bus by dport and uport respectively, but > their names do not make the lookup method clear. > > Rename find_cxl_port() to find_cxl_port_by_dport() to make the lookup > method explicit and consistent with find_cxl_port_by_uport(). Both > functions remain static to port.c; the upcoming patch that adds the > first cross-file caller will widen their scope. Could have mentioned the __ one, but it is fairly obvious why you did that even without saying it. Nice improvement Reviewed-by: Jonathan Cameron > > Co-developed-by: Terry Bowman > Signed-off-by: Terry Bowman > Signed-off-by: Dan Williams > > --- > > Changes in v17 -> v18: > - New commit > --- > drivers/cxl/core/port.c | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) > > diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c > index f90f899c31d07..cadb51f70f854 100644 > --- a/drivers/cxl/core/port.c > +++ b/drivers/cxl/core/port.c > @@ -1379,7 +1379,7 @@ static int match_port_by_dport(struct device *dev, const void *data) > return dport != NULL; > } > > -static struct cxl_port *__find_cxl_port(struct cxl_find_port_ctx *ctx) > +static struct cxl_port *__find_cxl_port_by_dport(struct cxl_find_port_ctx *ctx) > { > struct device *dev; > > @@ -1392,8 +1392,16 @@ static struct cxl_port *__find_cxl_port(struct cxl_find_port_ctx *ctx) > return NULL; > } > > -static struct cxl_port *find_cxl_port(struct device *dport_dev, > - struct cxl_dport **dport) > +/** > + * find_cxl_port_by_dport - find a cxl_port by one of its targets > + * @dport_dev: device representing the dport target > + * @dport: optional output of the 'struct cxl_dport' companion of the @dport_dev > + * > + * Return a 'struct cxl_port' with an elevated reference if found. Use > + * __free(put_cxl_port) to release. > + */ > +static struct cxl_port *find_cxl_port_by_dport(struct device *dport_dev, > + struct cxl_dport **dport) > { > struct cxl_find_port_ctx ctx = { > .dport_dev = dport_dev, > @@ -1401,7 +1409,7 @@ static struct cxl_port *find_cxl_port(struct device *dport_dev, > }; > struct cxl_port *port; > > - port = __find_cxl_port(&ctx); > + port = __find_cxl_port_by_dport(&ctx); > return port; > } > > @@ -1895,14 +1903,14 @@ EXPORT_SYMBOL_NS_GPL(devm_cxl_enumerate_ports, "CXL"); > struct cxl_port *cxl_pci_find_port(struct pci_dev *pdev, > struct cxl_dport **dport) > { > - return find_cxl_port(pdev->dev.parent, dport); > + return find_cxl_port_by_dport(pdev->dev.parent, dport); > } > EXPORT_SYMBOL_NS_GPL(cxl_pci_find_port, "CXL"); > > struct cxl_port *cxl_mem_find_port(struct cxl_memdev *cxlmd, > struct cxl_dport **dport) > { > - return find_cxl_port(grandparent(&cxlmd->dev), dport); > + return find_cxl_port_by_dport(grandparent(&cxlmd->dev), dport); > } > EXPORT_SYMBOL_NS_GPL(cxl_mem_find_port, "CXL"); >