All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/cxlpmu: Fix allocation argument order and minor formatting issues
@ 2025-06-23 18:44 Alok Tiwari
  2025-06-24 14:36 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Alok Tiwari @ 2025-06-23 18:44 UTC (permalink / raw)
  To: jonathan.cameron, will, mark.rutland, linux-cxl
  Cc: alok.a.tiwari, linux-perf-users

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>
---
 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;
 
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-24 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-06-24 17:31   ` ALOK TIWARI

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.