[PATCH] checkpatch: fix tab-size use on CODE_INDENT check

Antonio Borneo posted 1 patch 1 month, 2 weeks ago
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] checkpatch: fix tab-size use on CODE_INDENT check
Posted by Antonio Borneo 1 month, 2 weeks ago
From: Tomas Vanek <vanekt@fbl.cz>

Commit 713a09de9ca9 ("checkpatch: add command-line option for TAB
size") misses the check for CODE_INDENT where a fixed amount of 8
whitespaces is used in the regular expression.

Replace the fixed amount of whitespaces with the amount demanded
by the --tab-size option.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0492d6afc9a1f..6f290595892f6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3960,7 +3960,7 @@ sub process {
 # at the beginning of a line any tabs must come first and anything
 # more than $tabsize must use tabs.
 		if ($rawline =~ /^\+\s* \t\s*\S/ ||
-		    $rawline =~ /^\+\s*        \s*/) {
+		    $rawline =~ /^\+\s* {$tabsize}\s*/) {
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
 			$rpt_cleaners = 1;
 			if (ERROR("CODE_INDENT",

base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
-- 
2.34.1