linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Alok Tiwari <alok.a.tiwari@oracle.com>
Cc: <will@kernel.org>, <mark.rutland@arm.com>,
	<linux-cxl@vger.kernel.org>, <linux-perf-users@vger.kernel.org>
Subject: Re: [PATCH] perf/cxlpmu: Fix allocation argument order and minor formatting issues
Date: Tue, 24 Jun 2025 15:36:44 +0100	[thread overview]
Message-ID: <20250624153644.0000084f@huawei.com> (raw)
In-Reply-To: <20250623184415.42751-1-alok.a.tiwari@oracle.com>

On Mon, 23 Jun 2025 11:44:11 -0700
Alok Tiwari <alok.a.tiwari@oracle.com> wrote:

> Correct the argument order in devm_kcalloc() to follow the conventional
> count, size form to avoid any confusion or bugs.
> Also fix a formatting issue in the devm_kasprintf() call by removing a
> stray newline and fix a duplicated word in a comment.
> 
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Hi Alok,

This is a bit of an 'and' patch which usually means it should
be split up.  The devm_kcalloc() is a fix (sort of anyway)
which the others changes aren't.

All the actual changes are good, I'd just prefer this as a little series
of patches that do one thing each.  The first being the devm_kcalloc()
parameter ordering.

Thanks,

Jonathan



> ---
>  drivers/perf/cxl_pmu.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
> index d6693519eaee2..fb0b29f149807 100644
> --- a/drivers/perf/cxl_pmu.c
> +++ b/drivers/perf/cxl_pmu.c
> @@ -113,7 +113,7 @@ struct cxl_pmu_info {
>  
>  /*
>   * All CPMU counters are discoverable via the Event Capabilities Registers.
> - * Each Event Capability register contains a a VID / GroupID.
> + * Each Event Capability register contains a VID / GroupID.
>   * A counter may then count any combination (by summing) of events in
>   * that group which are in the Supported Events Bitmask.
>   * However, there are some complexities to the scheme.
> @@ -834,8 +834,8 @@ static int cxl_pmu_probe(struct device *dev)
>  	if (rc)
>  		return rc;
>  
> -	info->hw_events = devm_kcalloc(dev, sizeof(*info->hw_events),
> -				       info->num_counters, GFP_KERNEL);
> +	info->hw_events = devm_kcalloc(dev, info->num_counters,
> +				       sizeof(*info->hw_events), GFP_KERNEL);
>  	if (!info->hw_events)
>  		return -ENOMEM;
>  
> @@ -873,7 +873,7 @@ static int cxl_pmu_probe(struct device *dev)
>  		return rc;
>  	irq = rc;
>  
> -	irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_overflow\n", dev_name);
> +	irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_overflow", dev_name);
>  	if (!irq_name)
>  		return -ENOMEM;
>  


  reply	other threads:[~2025-06-24 14:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 18:44 [PATCH] perf/cxlpmu: Fix allocation argument order and minor formatting issues Alok Tiwari
2025-06-24 14:36 ` Jonathan Cameron [this message]
2025-06-24 17:31   ` ALOK TIWARI

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=20250624153644.0000084f@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@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;
as well as URLs for NNTP newsgroup(s).