Re: [PATCH] powerpc/perf: Use strstarts() to simplify is_thread_imc_pmu()

Athira Rajeev <[email protected]>
Newsgroups org.ozlabs.lists.linuxppc-dev,org.kernel.vger.linux-kernel
Message-ID <[email protected]>

> On 4 Jul 2026, at 5:43 PM, Thorsten Blum <[email protected]> wrote:
> 
> 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(-)
> 
> 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 <[email protected]>

Thanks
Athira

> static __be64 *get_event_base_addr(struct perf_event *event)
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.