]> git.proxmox.com Git - mirror_qemu.git/blobdiff - scripts/checkpatch.pl
error: Consistently name Error * objects err, and not errp
[mirror_qemu.git] / scripts / checkpatch.pl
index 574334b9857a183efd4fce703f376f41329f0315..efca817b9be15324f5d0e0eefc7b9eb9eb9b9ff7 100755 (executable)
@@ -1010,7 +1010,9 @@ sub possible {
                        case|
                        else|
                        asm|__asm__|
-                       do
+                       do|
+                       \#|
+                       \#\#
                )(?:\s|$)|
                ^(?:typedef|struct|enum)\b
            )}x;
@@ -1704,11 +1706,6 @@ sub process {
                        ERROR("open brace '{' following $1 go on the same line\n" . $hereprev);
                }
 
-# ... however, open braces on typedef lines should be avoided.
-               if ($line =~ /^.\s*typedef\s+(enum|union|struct)(?:\s+$Ident\b)?.*[^;]$/) {
-                       ERROR("typedefs should be separate from struct declaration\n" . $herecurr);
-               }
-
 # missing space after union, struct or enum definition
                if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?(?:\s+$Ident)?[=\{]/) {
                    ERROR("missing space after $1 definition\n" . $herecurr);
@@ -1893,19 +1890,6 @@ sub process {
                                                ERROR("space prohibited after that '$op' $at\n" . $hereptr);
                                        }
 
-
-                               # << and >> may either have or not have spaces both sides
-                               } elsif ($op eq '<<' or $op eq '>>' or
-                                        $op eq '&' or $op eq '^' or $op eq '|' or
-                                        $op eq '+' or $op eq '-' or
-                                        $op eq '*' or $op eq '/' or
-                                        $op eq '%')
-                               {
-                                       if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) {
-                                               ERROR("need consistent spacing around '$op' $at\n" .
-                                                       $hereptr);
-                                       }
-
                                # A colon needs no spaces before when it is
                                # terminating a case value or a label.
                                } elsif ($opv eq ':C' || $opv eq ':L') {
@@ -2463,8 +2447,8 @@ sub process {
                        WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
                }
 
-# recommend qemu_strto* over strto*
-               if ($line =~ /\b(strto.*?)\s*\(/) {
+# recommend qemu_strto* over strto* for numeric conversions
+               if ($line =~ /\b(strto[^k].*?)\s*\(/) {
                        WARN("consider using qemu_$1 in preference to $1\n" . $herecurr);
                }
 # check for module_init(), use category-specific init macros explicitly please