Extras: fix checkpatch.pl to use 4 spaces for a tab
authorDavid Goulet <dgoulet@efficios.com>
Fri, 11 Jan 2013 20:11:39 +0000 (15:11 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 11 Jan 2013 21:10:30 +0000 (16:10 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
extras/checkpatch.pl

index 7b2d29b0b6695a648fefe40b71fd8c5c267f3bc0..fdd84849badbcd77f8536ad327a9c32f1a6ee7fd 100755 (executable)
@@ -500,7 +500,7 @@ sub expand_tabs {
                if ($c eq "\t") {
                        $res .= ' ';
                        $n++;
-                       for (; ($n % 8) != 0; $n++) {
+                       for (; ($n % 4) != 0; $n++) {
                                $res .= ' ';
                        }
                        next;
@@ -1860,8 +1860,8 @@ sub process {
                                my $newindent = $2;
 
                                my $goodtabindent = $oldindent .
-                                       "\t" x ($pos / 8) .
-                                       " "  x ($pos % 8);
+                                       "\t" x ($pos / 4) .
+                                       " "  x ($pos % 4);
                                my $goodspaceindent = $oldindent . " "  x $pos;
 
                                if ($newindent ne $goodtabindent &&
@@ -2164,7 +2164,7 @@ sub process {
 
                        #print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n";
 
-                       if ($check && (($sindent % 8) != 0 ||
+                       if ($check && (($sindent % 4) != 0 ||
                            ($sindent <= $indent && $s ne ''))) {
                                WARN("SUSPECT_CODE_INDENT",
                                     "suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n");
This page took 0.03527 seconds and 4 git commands to generate.