public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cxl/acpi: simplify returning pointer without cleanup
Date: Wed, 3 Jul 2024 09:55:40 -0700	[thread overview]
Message-ID: <ZoWCjAHSOKQLDkF2@aschofie-mobl2> (raw)
In-Reply-To: <20240703083055.95864-1-krzysztof.kozlowski@linaro.org>

On Wed, Jul 03, 2024 at 10:30:55AM +0200, Krzysztof Kozlowski wrote:
> Use 'return_ptr' helper for returning a pointer without cleanup for
> shorter code.
> 

My first thought on this was that I prefer the explicitness
of pairing __free(kfree) with no_free_ptr as was done here.

cleanup.h defines this: 
#define return_ptr(p)   return no_free_ptr(p)

I did read the comments and am still confused. I see you posted a
handful of no_free_ptr to return_ptr patches. What is your selection
process for changing these?

--Alison


> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/cxl/acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> index 571069863c62..1e4bed8a933e 100644
> --- a/drivers/cxl/acpi.c
> +++ b/drivers/cxl/acpi.c
> @@ -339,7 +339,7 @@ static struct resource *alloc_cxl_resource(resource_size_t base,
>  	if (!res->name)
>  		return NULL;
>  
> -	return no_free_ptr(res);
> +	return_ptr(res);
>  }
>  
>  static int add_or_reset_cxl_resource(struct resource *parent, struct resource *res)
> -- 
> 2.43.0
> 

      parent reply	other threads:[~2024-07-03 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03  8:30 [PATCH] cxl/acpi: simplify returning pointer without cleanup Krzysztof Kozlowski
2024-07-03 16:07 ` Dan Williams
2024-07-04  6:17   ` Krzysztof Kozlowski
2024-07-03 16:55 ` Alison Schofield [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=ZoWCjAHSOKQLDkF2@aschofie-mobl2 \
    --to=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=krzysztof.kozlowski@linaro.org \
    --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