]> git.sur5r.net Git - u-boot/blobdiff - scripts/checkpatch.pl
lib: net_utils: make string_to_ip stricter
[u-boot] / scripts / checkpatch.pl
index 3fed5e4694f8aec4cd9d074f423f331d142332dc..84f57566fda65fe7867456180ca3de4647317416 100755 (executable)
@@ -2148,7 +2148,7 @@ sub process {
                                "please, no space before tabs\n" . $herevet) &&
                            $fix) {
                                while ($fixed[$linenr - 1] =~
-                                          s/(^\+.*) {8,8}+\t/$1\t\t/) {}
+                                          s/(^\+.*) {8,8}\t/$1\t\t/) {}
                                while ($fixed[$linenr - 1] =~
                                           s/(^\+.*) +\t/$1\t/) {}
                        }
@@ -2825,8 +2825,8 @@ sub process {
 
 # function brace can't be on same line, except for #defines of do while,
 # or if closed on same line
-               if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
-                   !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
+               if (($line=~/$Type\s*$Ident\(.*\).*\s\{/) and
+                   !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {
                        ERROR("OPEN_BRACE",
                              "open brace '{' following function declarations go on the next line\n" . $herecurr);
                }
@@ -3259,8 +3259,8 @@ sub process {
 ##             }
 
 #need space before brace following if, while, etc
-               if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
-                   $line =~ /do{/) {
+               if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) ||
+                   $line =~ /do\{/) {
                        if (ERROR("SPACING",
                                  "space required before the open brace '{'\n" . $herecurr) &&
                            $fix) {
@@ -3633,7 +3633,7 @@ sub process {
                            $dstat !~ /^for\s*$Constant$/ &&                            # for (...)
                            $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ &&   # for (...) bar()
                            $dstat !~ /^do\s*{/ &&                                      # do {...
-                           $dstat !~ /^\({/ &&                                         # ({...
+                           $dstat !~ /^\(\{/ &&                                                # ({...
                            $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/)
                        {
                                $ctx =~ s/\n*$//;
@@ -4263,7 +4263,7 @@ sub process {
                        }
                }
 
-# check for case / default statements not preceeded by break/fallthrough/switch
+# check for case / default statements not preceded by break/fallthrough/switch
                if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) {
                        my $has_break = 0;
                        my $has_statement = 0;
@@ -4284,7 +4284,7 @@ sub process {
                        }
                        if (!$has_break && $has_statement) {
                                WARN("MISSING_BREAK",
-                                    "Possible switch case/default not preceeded by break or fallthrough comment\n" . $herecurr);
+                                    "Possible switch case/default not preceded by break or fallthrough comment\n" . $herecurr);
                        }
                }