powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu()
PATCH 1/1 powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu()
Replace the open-coded implementation with strstarts() to simplify is_thread_imc_pmu().
Signed-off-by Thorsten Blum <[email protected]>
--- arch/powerpc/perf/imc-pmu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
arch/powerpc/perf/imc-pmu.c +1 -4
@@ -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)
Quoted 17 lines · Thorsten Blum
Replace the open-coded implementation with
strstarts()to simplifyis_thread_imc_pmu().Signed-off-by Thorsten Blum <[email protected]>---
arch/powerpc/perf/imc-pmu.c| 5 +----1 file changed, 1 insertion(+), 4 deletions(-)arch/powerpc/perf/imc-pmu.c +0
-0
arch/powerpc/perf/imc-pmu.c static int thread_imc_event_init(struct perf_event *event) · line 1028
Quoted 10 lines
arch/powerpc/perf/imc-pmu.c +1
-4@@ -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 <[email protected]>
Thanks
Athira
Quoted 3 lines
arch/powerpc/perf/imc-pmu.c +0
-0static __be64 *get_event_base_addr (struct perf_event *event)
Quoted 4 lines · Thorsten Blum
Replace the open-coded implementation with
strstarts()to simplifyis_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