[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1472493700.3425.67.camel@perches.com>
Date: Mon, 29 Aug 2016 11:01:40 -0700
From: Joe Perches <joe@...ches.com>
To: "Luck, Tony" <tony.luck@...el.com>,
"Levin, Alexander" <alexander.levin@...izon.com>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Sasha Levin <levinsasha928@...il.com>,
"ksummit-discuss@...ts.linuxfoundation.org"
<ksummit-discuss@...ts.linuxfoundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [Ksummit-discuss] checkkpatch (in)sanity ?
On Mon, 2016-08-29 at 17:46 +0000, Luck, Tony wrote:
> >
> > 80 columns is simply silly when dealing with either
> > long identifiers or many levels of indentation.
> >
> > One thing that 80 column limit does do is encourage
> > shorter identifiers and fewer levels of indentation.
> >
> > Generally, both of those are good things.
> I think the main complaint with the limit is that people fix it by simply
> breaking the long line, which often makes for less readable code.
>
> Perhaps there would be less pushback on this if checkpatch also
> complained about clumsily broken long lines and offered the advice
> to restructure the code with helper functions etc. to avoid deep
> indentation?
It suggests that already for 6+ leading tabs, but some more
intelligence for nominally ugly added line breaks would
definitely help.
Using longish simple identifiers or multiple dereferences
can make the line breaks at 80 columns silly.
Simple things like:
if (longish_identifier != AN_EVEN_LONGER_DEFINED_CONSTANT_VALUE)
and
if (some_pointer->member[index].another_member >> shift_constant)
shouldn't really ever be broken into multiple lines,
but I see that submitted by some names I haven't seen
before all the time.
It's not an easy problem to solve with regexes though.
> FWIW I do find checkpatch is helpful enough with useful tips
> that it has value even when it generates some noise. Generally
> the better you are at conforming to kernel style, the more irritating
> it will be, because you only see the questionable output. For
> newbies, and less frequent contributors (especially those who
> work on other projects with other style guides) it is likely still
> doing a good job.
>
> In the journey from 4.6 to 4.7 we had 13433 commits. 2258 (16%)
> from people with 5 or fewer commits in that release. Those are
> the people most helped by checkpatch (plus the maintainers who
> took those patches didn't have to spend as many cycles complaining
> about style).
>
> I think the bottom line is whether checkpatch's helpful messages do
> more good than the grey area messages that cause people to make
> questionable changes to shut checkpatch up.
>
> -Tony
Powered by blists - more mailing lists