From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754390AbcH2SrF (ORCPT ); Mon, 29 Aug 2016 14:47:05 -0400 Received: from smtprelay0047.hostedemail.com ([216.40.44.47]:35803 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750786AbcH2SrE (ORCPT ); Mon, 29 Aug 2016 14:47:04 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2197:2199:2393:2559:2562:2828:2898:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3874:4043:4321:4823:5007:10004:10400:10848:11232:11658:11783:11914:12043:12048:12555:12740:13069:13311:13357:13439:13894:14659:14721:21080:21221:30012: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:1,LUA_SUMMARY:none X-HE-Tag: teeth31_3d5602f288208 X-Filterd-Recvd-Size: 2079 Message-ID: <1472496420.3425.77.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:47:00 -0700 In-Reply-To: <1472493700.3425.67.camel@perches.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> <1472493700.3425.67.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2016-08-29 at 11:01 -0700, Joe Perches wrote: > On Mon, 2016-08-29 at 17:46 +0000, Luck, Tony wrote: > > [checkpatch] offered the advice > > to restructure the code with helper functions etc. to avoid deep > > indentation? > It suggests that already for 6+ leading tabs, And here's an inexact little histogram of the code that expands indent levels in the -next kernel source tree. $ grep -rP --include=*.[ch] -oh "^[\t]+(do|while|for|if|else|return|goto|continue|switch|default|case|break)\b" * | \   sed -r 's/^(\t+).*$/\1/' | awk '{print length($0)}' | sort -n | uniq -c 1217165 1  783085 2  249655 3   59775 4   11653 5    1993 6     444 7     158 8      50 9      19 10      10 11       4 12       1 13 Some of that code, as Linus once put it, is eye-gouging. Luckily, almost all of the 7+ tab indent code is prehistoric.