Re: [PATCH] checkpatch: make the line length warnings match the coding style document

From: Joe Perches
Date: Tue Dec 22 2020 - 11:22:52 EST


On Tue, 2020-12-22 at 14:12 +0100, Christoph Hellwig wrote:
> On Mon, Dec 21, 2020 at 08:08:20PM -0800, Joe Perches wrote:
> > On Thu, 2020-12-10 at 13:27 -0800, Joe Perches wrote:
> > > On Thu, 2020-12-10 at 20:09 +0000, Matthew Wilcox wrote:
> > > > On Thu, Dec 10, 2020 at 12:05:04PM -0800, Joe Perches wrote:
> > > > > Also, given the ever increasing average identifier length, strict
> > > > > adherence to 80 columns is sometimes just not possible without silly
> > > > > visual gymnastics. The kernel now has quite a lot of 30+ character
> > > > > length function names, constants, and structs.
> > > >
> > > > maybe checkpatch should warn for identifiers that are 30+ characters
> > > > long? address the problem at its source ..
> > >
> > > Hard to know when to warn as patches could just add uses of already
> > > existing names and emitting warnings for those would just be annoying.
> > >
> > > Maybe something that tests long identifier additions of
> > > defines/functions/macros/structs but not their uses and maybe only
> > > then in patches and not files.
> > >
> > > Perhaps:
> >
> > Anyone care that this should be added or not added to checkpatch?
>
> It is pretty useless.

Maybe so, if only because I chose a high value for the max id length
to avoid controversy. I would prefer something like 20.

> What we need is a patch that doesn't make people
> uselessly add overly long lines against the intent of the coding style
> document. I have submitted a pretty reasonable one, and I'm open to
> alternatives, but we need to to stop people submitting code that does
> not fit the coding style all the time because checkpatch doesn't
> complain.

Having checkpatch complain about > 80 column lines didn't stop
patches before, likely it wouldn't stop patches now.

Emitting yet more messages for trivial lines > 80 columns is also
against the intent of the commit that changed the line length maximum.

commit bdc48fa11e46f867ea4d75fa59ee87a7f48be144
checkpatch/coding-style: deprecate 80-column warning

The effect of your patch might as well revert the checkpatch portion
of that commit.

I think that's not a great idea for the reason in the commit message.