Linux CXL
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: linux-cxl@vger.kernel.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v2] cxl/acpi: Cleanup __cxl_parse_cfmws()
Date: Fri, 1 Mar 2024 10:29:36 -0800	[thread overview]
Message-ID: <ZeIekICjXpqVUrUG@aschofie-mobl2> (raw)
In-Reply-To: <170915213220.2419769.6117155173006983208.stgit@dwillia2-xfh.jf.intel.com>

On Wed, Feb 28, 2024 at 12:30:56PM -0800, Dan Williams wrote:
> As a follow on to the recent rework of __cxl_parse_cfmws() to always
> return errors [1], use cleanup.h helpers to remove goto and other cleanups
> now that logging is moved to the cxl_parse_cfmws() wrapper.

one question about helper below...


>
snip

> +static struct resource *alloc_cxl_resource(resource_size_t base,
> +					   resource_size_t n, const char *fmt,
> +					   ...)
> +{
> +	va_list ap;
> +
> +	struct resource *res __free(kfree) = kzalloc(sizeof(*res), GFP_KERNEL);
> +	if (!res)
> +		return NULL;
> +
> +	res->start = base;
> +	res->end = base + n - 1;
> +	res->flags = IORESOURCE_MEM;
> +
> +	va_start(ap, fmt);
> +	res->name = kvasprintf(GFP_KERNEL, fmt, ap);
> +	va_end(ap);

Why is alloc_cxl_resource() defined w variable params and using
kvasprintf(), rather than tailored to the one caller and used
kasprintf()?

Perhaps you have bigger plans for this helper?

Other than that,

Reviewed-by: Alison Schofield <alison.schofield@gmail.com>

> +

snip


  parent reply	other threads:[~2024-03-01 18:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 20:30 [PATCH v2] cxl/acpi: Cleanup __cxl_parse_cfmws() Dan Williams
2024-03-01  0:57 ` Verma, Vishal L
2024-03-01 18:29 ` Alison Schofield [this message]
2024-03-01 19:19   ` Alison Schofield
2024-03-01 19:34   ` Dan Williams
2024-04-05 22:05 ` [PATCH v3] " Dan Williams
2024-04-05 23:56   ` Alison Schofield
2024-04-22 15:59   ` Jonathan Cameron
2024-04-30 22:46     ` Dan Williams
2024-05-01 12:21       ` Jonathan Cameron

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=ZeIekICjXpqVUrUG@aschofie-mobl2 \
    --to=alison.schofield@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    /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