]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu()
authorThorsten Blum <thorsten.blum@linux.dev>
Sat, 4 Jul 2026 12:13:54 +0000 (14:13 +0200)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Tue, 28 Jul 2026 04:53:31 +0000 (10:23 +0530)
Replace the open-coded implementation with strstarts() to simplify
is_thread_imc_pmu().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Athira Rajeev <atrajeev@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260704121353.201583-3-thorsten.blum@linux.dev
arch/powerpc/perf/imc-pmu.c

index e3822f36c4199dd71af33542236d821a59b8a204..1d2db6d3e2264eb21057f646090f55b67b182c3a 100644 (file)
@@ -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)