[PATCH] Add skiplinelength parameter
From: iveqy
Date: Sat Jun 12 2010 - 12:57:51 EST
---
scripts/checkpatch.pl | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bd88f11..e0683f4 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -29,6 +29,7 @@ my $summary_file = 0;
my $root;
my %debug;
my $help = 0;
+my $skip_line_length = 0;
sub help {
my ($exitcode) = @_;
@@ -49,6 +50,7 @@ Options:
--root=PATH PATH to the kernel tree root
--no-summary suppress the per-file summary
--mailback only produce a report in case of warnings/errors
+ --skiplinelength skip check for long lines
--summary-file include the filename in summary
--debug KEY=[0|1] turn on/off debugging of KEY, where KEY is one of
'values', 'possible', 'type', and 'attr' (default
@@ -81,6 +83,7 @@ GetOptions(
'debug=s' => \%debug,
'test-only=s' => \$tst_only,
'h|help' => \$help,
+ 'skiplinelength!' => \$skip_line_length,
'version' => \$help
) or help(1);
@@ -1401,12 +1404,13 @@ sub process {
next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
#80 column limit
- if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
- $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
- $line !~ /^\+\s*$logFunctions\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ &&
- $length > 80)
- {
- WARN("line over 80 characters\n" . $herecurr);
+ if(!$skip_line_length) {
+ if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
+ $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
+ $line !~ /^\+\s*$logFunctions\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ &&
+ $length > 80) {
+ WARN("line over 80 characters\n" . $herecurr);
+ }
}
# check for spaces before a quoted newline
--
1.6.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/