[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1282146409-30544-2-git-send-email-apw@canonical.com>
Date: Wed, 18 Aug 2010 16:46:34 +0100
From: Andy Whitcroft <apw@...onical.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
Andy Whitcroft <apw@...onical.com>
Subject: [PATCH 01/16] checkpatch: fix regressions in "fix handling of leading spaces"
The patch below added checks for leading spaces on lines, but this
introduces regressions. Firstly it does not correctly detect when we are
in a comment. Secondly it does not allow for preprocessor command spacing.
Finally it does not allow for label indentation which is required to be
less than one tab. Fix these up:
checkpatch: fix handling of leading spaces:
Signed-off-by: Andy Whitcroft <apw@...onical.com>
---
scripts/checkpatch.pl | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2039acd..0a87c74 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1459,10 +1459,13 @@ sub process {
}
# check for spaces at the beginning of a line.
- if ($rawline =~ /^\+ / && $rawline !~ /\+ +\*/) {
+# Exceptions:
+# 1) within comments
+# 2) indented preprocessor commands
+# 3) hanging labels
+ if ($rawline =~ /^\+ / && $line !~ /\+ *(?:$;|#|$Ident:)/) {
my $herevet = "$here\n" . cat_vet($rawline) . "\n";
- WARN("please, no space for starting a line, \
- excluding comments\n" . $herevet);
+ WARN("please, no spaces at the start of a line\n" . $herevet);
}
# check we are in a valid C source file if not then ignore this hunk
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists