mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu()
@ 2026-07-04 12:13 Thorsten Blum
  2026-07-24  3:51 ` Athira Rajeev
  2026-07-30  5:41 ` Madhavan Srinivasan
  0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-07-04 12:13 UTC (permalink / raw)
  To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP),
	Kees Cook, Shrikanth Hegde, Yury Norov
  Cc: Thorsten Blum, linuxppc-dev, linux-kernel

Replace the open-coded implementation with strstarts() to simplify
is_thread_imc_pmu().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/powerpc/perf/imc-pmu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index e3822f36c419..1d2db6d3e226 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -1023,10 +1023,7 @@ static int thread_imc_event_init(struct perf_event *event)
 
 static bool is_thread_imc_pmu(struct perf_event *event)
 {
-	if (!strncmp(event->pmu->name, "thread_imc", strlen("thread_imc")))
-		return true;
-
-	return false;
+	return strstarts(event->pmu->name, "thread_imc");
 }
 
 static __be64 *get_event_base_addr(struct perf_event *event)

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

* Re: [PATCH] powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu()
  2026-07-04 12:13 [PATCH] powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu() Thorsten Blum
@ 2026-07-24  3:51 ` Athira Rajeev
  2026-07-30  5:41 ` Madhavan Srinivasan
  1 sibling, 0 replies; 3+ messages in thread
From: Athira Rajeev @ 2026-07-24  3:51 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP),
	Kees Cook, Shrikanth Hegde, Yury Norov, linuxppc-dev,
	linux-kernel



> On 4 Jul 2026, at 5:43 PM, Thorsten Blum <thorsten.blum@linux.dev> wrote:
> 
> Replace the open-coded implementation with strstarts() to simplify
> is_thread_imc_pmu().
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/powerpc/perf/imc-pmu.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
> index e3822f36c419..1d2db6d3e226 100644
> --- a/arch/powerpc/perf/imc-pmu.c
> +++ b/arch/powerpc/perf/imc-pmu.c
> @@ -1023,10 +1023,7 @@ static int thread_imc_event_init(struct perf_event *event)
> 
> static bool is_thread_imc_pmu(struct perf_event *event)
> {
> - if (!strncmp(event->pmu->name, "thread_imc", strlen("thread_imc")))
> - return true;
> -
> - return false;
> + return strstarts(event->pmu->name, "thread_imc");
> }
> 

Reviewed-by: Athira Rajeev <atrajeev@linux.ibm.com>

Thanks
Athira

> static __be64 *get_event_base_addr(struct perf_event *event)
> 
> 


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

* Re: [PATCH] powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu()
  2026-07-04 12:13 [PATCH] powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu() Thorsten Blum
  2026-07-24  3:51 ` Athira Rajeev
@ 2026-07-30  5:41 ` Madhavan Srinivasan
  1 sibling, 0 replies; 3+ messages in thread
From: Madhavan Srinivasan @ 2026-07-30  5:41 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Kees Cook, Shrikanth Hegde, Yury Norov, Thorsten Blum
  Cc: linuxppc-dev, linux-kernel

On Sat, 04 Jul 2026 14:13:54 +0200, Thorsten Blum wrote:
> Replace the open-coded implementation with strstarts() to simplify
> is_thread_imc_pmu().
> 
> 

Applied to powerpc/fixes.

[1/1] powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu()
      https://git.kernel.org/powerpc/c/d71b3ca5231750fecdefb3390595e7db30979ac4

cheers

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

end of thread, other threads:[~2026-07-30  5:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-04 12:13 [PATCH] powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu() Thorsten Blum
2026-07-24  3:51 ` Athira Rajeev
2026-07-30  5:41 ` Madhavan Srinivasan

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®