lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V6 2/3] perf tools: parse the pmu event prefix and surfix
On Thu, Oct 02, 2014 at 05:33:07PM +0000, Liang, Kan wrote:
>
>
> > >
> > > +static int
> > > +comp_pmu(const void *p1, const void *p2) {
> > > + struct perf_pmu_event_symbol *pmu1 =
> > > + (struct perf_pmu_event_symbol *) p1;
> > > + struct perf_pmu_event_symbol *pmu2 =
> > > + (struct perf_pmu_event_symbol *) p2;
> >
> > please keep it on one line, like:
> > const struct perf_pmu_event_symbol *pmu1 = p1;
> > const struct perf_pmu_event_symbol *pmu2 = p2;
> >
>
>
> Removing (struct perf_pmu_event_symbol *) will cause compiler error as below.
>
> util/parse-events.c:877:39: error: initialization discards âconstâ qualifier from pointer target type [-Werror]
> struct perf_pmu_event_symbol *pmu1 = p1;
>
> If we keep (struct perf_pmu_event_symbol *), we may not keep it on one line. The line will over 80 characters. There will be error from checkpatch.pl.
>
>
> > > + perf_pmu_events_list =
> > > + malloc(sizeof(struct perf_pmu_event_symbol) * len);
> >
> > please keep above on one line
>
> If so, the line will over 80 characters. There will be error from checkpatch.pl.

AFAIK we are not that strict on this warning.. I think the current
notion is to keep the code easy to read with reasonable breakages
of this rule

jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-10-03 11:01    [W:0.077 / U:1.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site