From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756084AbcH2SBp (ORCPT ); Mon, 29 Aug 2016 14:01:45 -0400 Received: from smtprelay0132.hostedemail.com ([216.40.44.132]:37740 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755381AbcH2SBo (ORCPT ); Mon, 29 Aug 2016 14:01:44 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2687:2693:2828:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4043:4321:4560:4823:5007:7903:10004:10400:10848:11026:11232:11473:11658:11914:12043:12048:12438:12555:12740:13439:14096:14097:14659:14721:21080:21324:21433:30012:30030:30054:30064:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: rose93_661109d9cb84e X-Filterd-Recvd-Size: 3441 Message-ID: <1472493700.3425.67.camel@perches.com> Subject: Re: [Ksummit-discuss] checkkpatch (in)sanity ? From: Joe Perches To: "Luck, Tony" , "Levin, Alexander" Cc: Greg KH , Sasha Levin , "ksummit-discuss@lists.linuxfoundation.org" , LKML Date: Mon, 29 Aug 2016 11:01:40 -0700 In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F3A1B3222@ORSMSX114.amr.corp.intel.com> References: <1472330452.26978.23.camel@perches.com> <20160828005636.GB19088@sasha-lappy> <1472348579.26978.47.camel@perches.com> <20160828023807.GC19088@sasha-lappy> <1472404557.26978.84.camel@perches.com> <3908561D78D1C84285E8C5FCA982C28F3A1B3222@ORSMSX114.amr.corp.intel.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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