From patchwork Fri Dec 18 05:12:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 68701 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBIEWTuo010791 for ; Fri, 18 Dec 2009 14:32:29 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 5037261B517; Fri, 18 Dec 2009 09:32:29 -0500 (EST) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id nBI5Cexi003744 for ; Fri, 18 Dec 2009 00:12:41 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBI5Ceka031524; Fri, 18 Dec 2009 00:12:40 -0500 Received: from mail.perches.com (mail.perches.com [173.55.12.10]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBI5CQd3024180; Fri, 18 Dec 2009 00:12:27 -0500 Received: from [192.168.1.151] (Joe-Laptop.home [192.168.1.151]) by mail.perches.com (Postfix) with ESMTP id 9B76224368; Thu, 17 Dec 2009 21:12:16 -0800 (PST) From: Joe Perches To: Valdis.Kletnieks@vt.edu, Andy Whitcroft , Andrew Morton In-Reply-To: <24653.1261110557@localhost> References: <20091217061229.GD3946@linux-sh.org> <24653.1261110557@localhost> Date: Thu, 17 Dec 2009 21:12:24 -0800 Message-ID: <1261113144.13734.317.camel@Joe-Laptop.home> Mime-Version: 1.0 X-RedHat-Spam-Score: -1.467 (AWL) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.11 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Fri, 18 Dec 2009 09:32:25 -0500 Cc: linux-kernel@vger.kernel.org, dm-devel@redhat.com, Paul Mundt , Mikulas Patocka , Linus Torvalds , Alasdair G Kergon , Krzysztof Halasa Subject: [dm-devel] [PATCH] scripts/checkpatch.pl: Change long line warning to 105 chars X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index bc4114f..c358251 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1374,13 +1374,20 @@ sub process { # check we are in a valid source file if not then ignore this hunk next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); -#80 column limit +#Line too long if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && $rawline !~ /^.\s*\*\s*\@$Ident\s/ && - $line !~ /^\+\s*printk\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ && - $length > 80) - { - WARN("line over 80 characters\n" . $herecurr); + $line !~ /^\+\s*printk\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/) { + if ($length > 105) { + WARN("line over 105 characters\n" . $herecurr); + } elsif ($length > 80) { + CHK("line over 80 characters\n" . $herecurr); + } + } + +#too many leading tabs - deep leading indent + if ($line =~ /^\+ {6,}(?!(.*,$|.*\);$))/) { + CHK("Too many leading tabs. Consider restructuring code\n" . $herecurr); } # check for adding lines without a newline.