lkml.org 
[lkml]   [2021]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf pmu: Fix event list for uncore PMUs
On Tue, Dec 21, 2021 at 09:10:37AM +0000, John Garry wrote:
> On 21/12/2021 07:58, Jiri Olsa wrote:
> > > + /* Different names -> never duplicates */
> > > + if (strcmp(alias_a->name, alias_b->name))
> > > + return false;
> > > + if (!alias_a->pmu)
> > > + return true;
> > > + if (!alias_b->pmu)
> > > + return true;
> > nit could be:
> >
> > if (!alias_a->pmu || !alias_b->pmu)
> > return true;
> >
> > would be great to have more comments explaining the check
> >
>
> This is just a sanity check that both strings are non-NULL as we do a
> strcmp() next. So would this be better:
>
> if (!alias_a->pmu || !alias_b->pmu || !strcmp(alias_a->pmu, alias_b->pmu))
> return true
>
> ?
>
> It will spill a line.

sure, it cought my eye because the is_cpu check later is done on
the same line, so I started wondering what's the difference ;-)

jirka

>
> Thanks,
> John
>
> > thanks,
> > jirka
> >
> > > + if (!strcmp(alias_a->pmu, alias_b->pmu))
> > > + return true;
> > > + /* uncore PMUs */
>
>

\
 
 \ /
  Last update: 2021-12-21 10:36    [W:0.050 / U:2.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site