public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
From: Gregory Price <gourry@gourry.net>
To: Dave Jiang <dave.jiang@intel.com>
Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com, dave@stgolabs.net,
	jonathan.cameron@huawei.com, alison.schofield@intel.com,
	vishal.l.verma@intel.com, ira.weiny@intel.com,
	dan.j.williams@intel.com
Subject: Re: [PATCH v3 3/3] cxl/core: use cleanup.h for devm_cxl_add_dax_region
Date: Fri, 20 Feb 2026 00:23:54 -0500	[thread overview]
Message-ID: <aZfv6qQR5DoZ7Chp@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <68d44fc4-55fe-42df-85ea-cffc60454325@intel.com>

On Tue, Feb 17, 2026 at 04:55:13PM -0700, Dave Jiang wrote:
> 
> 
> On 2/11/26 1:42 PM, Gregory Price wrote:
> > Cleanup the gotos in the function.
> > 
> > No functional change intended.
> > 
> > Signed-off-by: Gregory Price <gourry@gourry.net>
> > ---
> >  drivers/cxl/core/region_dax.c | 21 ++++++++-------------
> >  drivers/cxl/cxl.h             |  1 +
> >  2 files changed, 9 insertions(+), 13 deletions(-)
> > 
> > diff --git a/drivers/cxl/core/region_dax.c b/drivers/cxl/core/region_dax.c
> > index c8dd2bd1d9b9..49907c6c7620 100644
> > --- a/drivers/cxl/core/region_dax.c
> > +++ b/drivers/cxl/core/region_dax.c
> > @@ -81,29 +81,24 @@ static void cxlr_dax_unregister(void *_cxlr_dax)
> >  
> >  int devm_cxl_add_dax_region(struct cxl_region *cxlr)
> >  {
> > -	struct cxl_dax_region *cxlr_dax;
> > -	struct device *dev;
> > +	struct cxl_dax_region *cxlr_dax __free(put_cxl_dax_region) = NULL;
> >  	int rc;
> >  
> >  	cxlr_dax = cxl_dax_region_alloc(cxlr);
> 
> The typical __cleanup() pattern is to move the variable declaration here in order to minimize unintended issues between declare and check.
>

Ah, relatively new pattern for me, i'll clean it up

> >  	if (IS_ERR(cxlr_dax))
> >  		return PTR_ERR(cxlr_dax);
> >  
> > -	dev = &cxlr_dax->dev;
> 
> Given that this local var is used multiple times, maybe we should keep it?
> 

Fair, will re-spin claned up

~Gregory

      reply	other threads:[~2026-02-20  5:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 20:42 [PATCH v3 0/3] pull region-specific logic into new files Gregory Price
2026-02-11 20:42 ` [PATCH v3 1/3] cxl/core/region: move pmem region driver logic into region_pmem.c Gregory Price
2026-02-11 20:42 ` [PATCH v3 2/3] cxl/core/region: move dax region device logic into region_dax.c Gregory Price
2026-02-11 20:42 ` [PATCH v3 3/3] cxl/core: use cleanup.h for devm_cxl_add_dax_region Gregory Price
2026-02-17 23:55   ` Dave Jiang
2026-02-20  5:23     ` Gregory Price [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aZfv6qQR5DoZ7Chp@gourry-fedora-PF4VCD3F \
    --to=gourry@gourry.net \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kernel-team@meta.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox