mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] perf/arm_pmu_platform: Fix an error message related to dev_err_probe() usage
@ 2022-08-05 20:55 Christophe JAILLET
  2022-08-08 14:57 ` Robin Murphy
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2022-08-05 20:55 UTC (permalink / raw)
  To: Will Deacon, Mark Rutland, Robin Murphy
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-arm-kernel

dev_err() is a macro that expand dev_fmt, but dev_err_probe() is a
function and cannot perform this macro expansion.

So hard code the "hw perfevents: " prefix and dd a comment explaining why.

Fixes: 11fa1dc8020a ("perf/arm_pmu_platform: Use dev_err_probe() for IRQ errors")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Untested, but I can't see how it could work.

v1 --> v2
  - fix a typo in the comment
---
 drivers/perf/arm_pmu_platform.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
index 513de1f54e2d..02cca4b8f0fd 100644
--- a/drivers/perf/arm_pmu_platform.c
+++ b/drivers/perf/arm_pmu_platform.c
@@ -101,8 +101,11 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)
 	struct device *dev = &pdev->dev;
 
 	num_irqs = platform_irq_count(pdev);
-	if (num_irqs < 0)
-		return dev_err_probe(dev, num_irqs, "unable to count PMU IRQs\n");
+	if (num_irqs < 0) {
+		/* dev_err_probe() does not handle dev_fmt, so hard-code the prefix */
+		return dev_err_probe(dev, num_irqs,
+				     "hw perfevents: unable to count PMU IRQs\n");
+	}
 
 	/*
 	 * In this case we have no idea which CPUs are covered by the PMU.
-- 
2.34.1


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

end of thread, other threads:[~2022-08-10 20:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 20:55 [PATCH v2] perf/arm_pmu_platform: Fix an error message related to dev_err_probe() usage Christophe JAILLET
2022-08-08 14:57 ` Robin Murphy
2022-08-10 20:01   ` Christophe JAILLET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®