1. 06 3月, 2018 1 次提交
  2. 22 1月, 2018 1 次提交
  3. 16 1月, 2018 1 次提交
    • E
      checkpatch: Enforce proper do/while (0) style · f4bdc13e
      Eric Blake 提交于
      Use of a loop construct for code that is not intended to repeat
      does not make much idiomatic sense, except in one place: it is a
      common usage in macros in order to wrap arbitrary code with
      single-statement semantics.  But when used in a macro, it is more
      typical for the caller to supply the trailing ';' when calling
      the macro.
      
      Although qemu coding style frowns on bare:
        if (cond)
          statement1;
        else
          statement2;
      where extra semicolons actually cause syntax errors, we still
      want our macro styles to be easily copied to other projects.
      Thus, declare it an error if we encounter any form of 'while (0)'
      with a semicolon in the same line.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20171201232433.25193-8-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f4bdc13e
  4. 21 12月, 2017 1 次提交
  5. 19 10月, 2017 1 次提交
  6. 12 10月, 2017 1 次提交
  7. 05 10月, 2017 1 次提交
  8. 19 9月, 2017 2 次提交
    • G
      checkpatch: add hwaddr to @typeList · 825bfa00
      Greg Kurz 提交于
      The script doesn't know about all possible types and learn them as
      it parses the code. If it reaches a line with a type cast but the
      type isn't known yet, it is misinterpreted as an identifier.
      
      For example the following line:
      
          foo = (hwaddr) -1;
      
      results in the following false-positive to be reported:
      
      ERROR: spaces required around that '-' (ctx:VxV)
      
      Let's add this standard QEMU type to the list of pre-known types.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <150538015789.8149.10902725348939486674.stgit@bahia.lan>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      825bfa00
    • D
      scripts: let checkpatch.pl process an entire GIT branch · 8e1fe175
      Daniel P. Berrange 提交于
      Currently before submitting a series, devs should run checkpatch.pl
      across each patch to be submitted. This can be automated using a
      command such as:
      
        git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'
      
      This is rather long winded to type, so this patch introduces a way
      to tell checkpatch.pl to validate a series of GIT revisions.
      
      There are now three modes it can operate in 1) check a patch 2) check a source
      file, or 3) check a git branch.
      
      If no flags are given, the mode is determined by checking the args passed to
      the command. If the args contain a literal ".." it is treated as a GIT revision
      list. If the args end in ".patch" or equal "-" it is treated as a patch file.
      Otherwise it is treated as a source file.
      
      This automatic guessing can be overridden using --[no-]patch --[no-]file or
      --[no-]branch
      
      For example to check a GIT revision list:
      
          $ ./scripts/checkpatch.pl master..
          total: 0 errors, 0 warnings, 297 lines checked
      
          b886d352a2bf58f0996471fb3991a138373a2957 has no obvious style problems and is ready for submission.
          total: 0 errors, 0 warnings, 182 lines checked
      
          2a731f9a9ce145e0e0df6d42dd2a3ce4dfc543fa has no obvious style problems and is ready for submission.
          total: 0 errors, 0 warnings, 102 lines checked
      
          11844169bcc0c8ed4449eb3744a69877ed329dd7 has no obvious style problems and is ready for submission.
      
      If a genuine patch filename contains the characters '..' it is
      possible to force interpretation of the arg as a patch
      
        $ ./scripts/checkpatch.pl --patch master..
      
      will force it to load a patch file called "master..", or equivalently
      
        $ ./scripts/checkpatch.pl --no-branch master..
      
      will simply turn off guessing of GIT revision lists.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <20170913091000.9005-1-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8e1fe175
  9. 01 8月, 2017 1 次提交
  10. 13 7月, 2017 2 次提交
  11. 04 7月, 2017 1 次提交
  12. 10 5月, 2017 1 次提交
    • K
      scripts: Switch to more portable Perl shebang · b7d5a9c2
      Kamil Rytarowski 提交于
      The default NetBSD package manager is pkgsrc and it installs Perl
      along other third party programs under custom and configurable prefix.
      The default prefix for binary prebuilt packages is /usr/pkg, and the
      Perl executable lands in /usr/pkg/bin/perl.
      
      This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's
      the most portable solution that should work for almost everybody.
      Perl's executable is detected automatically.
      
      This change switches -w option passed to the executable with more
      modern "use warnings;" approach. There is no functional change to the
      default behavior.
      Signed-off-by: NKamil Rytarowski <n54@gmx.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      b7d5a9c2
  13. 05 5月, 2017 1 次提交
    • D
      checkpatch: Disallow glib asserts in main code · 6e938956
      Dr. David Alan Gilbert 提交于
      Glib commit a6a875068779 (from 2013) made many of the glib assert
      macros non-fatal if a flag is set.
      This causes two problems:
        a) Compilers moan that your code is unsafe even though you've
           put an assert in before the point of use.
        b) Someone evil could, in a library, call
           g_test_set_nonfatal_assertions() and cause our assertions in
           important places not to fail and potentially allow memory overruns.
      
      Ban most of the glib assertion functions (basically everything except
      g_assert and g_assert_not_reached) except in tests/
      
      This makes checkpatch gives an error such as:
      
        ERROR: Use g_assert or g_assert_not_reached
        #77: FILE: vl.c:4725:
        +    g_assert_cmpstr("Chocolate", >, "Cheese");
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20170427165526.19836-1-dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6e938956
  14. 02 11月, 2016 1 次提交
  15. 01 11月, 2016 1 次提交
  16. 27 9月, 2016 1 次提交
  17. 14 9月, 2016 1 次提交
  18. 10 8月, 2016 6 次提交
  19. 08 8月, 2016 1 次提交
  20. 02 8月, 2016 1 次提交
  21. 18 7月, 2016 1 次提交
  22. 17 7月, 2016 1 次提交
    • S
      checkpatch: consider git extended headers valid patches · d211bd60
      Stefan Hajnoczi 提交于
      Renames look like this with git-diff(1) when diff.renames = true is set:
      
        diff --git a/a b/b
        similarity index 100%
        rename from a
        rename to b
      
      This raises the "Does not appear to be a unified-diff format patch"
      error because checkpatch.pl only considers a diff valid if it contains
      at least one "@@" hunk.
      
      This patch accepts renames and copies too so that checkpatch.pl exits
      successfully when a diff only renames/copies files.  The git diff
      extended header format is described on the git-diff(1) man page.
      Reported-by: NColin Lord <clord@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <1468576014-28788-1-git-send-email-stefanha@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d211bd60
  23. 30 6月, 2016 1 次提交
  24. 18 5月, 2016 1 次提交
  25. 05 4月, 2016 1 次提交
  26. 16 2月, 2016 2 次提交
  27. 13 1月, 2016 1 次提交
  28. 11 1月, 2016 1 次提交
  29. 13 10月, 2015 2 次提交
  30. 25 9月, 2015 1 次提交
  31. 16 9月, 2015 1 次提交