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

From: Antonio Borneo

Date: Mon Apr 27 2026 - 08:18:42 EST


From: Tomas Vanek <vanekt@xxxxxx>

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@xxxxxx>
Signed-off-by: Antonio Borneo <antonio.borneo@xxxxxxxxxxx>
---
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