1. 21 1月, 2019 1 次提交
  2. 14 1月, 2019 1 次提交
  3. 08 1月, 2019 1 次提交
  4. 05 1月, 2019 1 次提交
  5. 07 12月, 2018 1 次提交
  6. 12 4月, 2018 1 次提交
    • M
      clang-format: add configuration file · d4ef8d3f
      Miguel Ojeda 提交于
      clang-format is a tool to format C/C++/...  code according to a set of
      rules and heuristics.  Like most tools, it is not perfect nor covers
      every single case, but it is good enough to be helpful.
      
      In particular, it is useful for quickly re-formatting blocks of code
      automatically, for reviewing full files in order to spot coding style
      mistakes, typos and possible improvements.  It is also handy for sorting
      ``#includes``, for aligning variables and macros, for reflowing text and
      other similar tasks.  It also serves as a teaching tool/guide for
      newcomers.
      
      The tool itself has been already included in the repositories of popular
      Linux distributions for a long time.  The rules in this file are
      intended for clang-format >= 4, which is easily available in most
      distributions.
      
      This commit adds the configuration file that contains the rules that the
      tool uses to know how to format the code according to the kernel coding
      style.  This gives us several advantages:
      
        * clang-format works out of the box with reasonable defaults;
          avoiding that everyone has to re-do the configuration.
      
        * Everyone agrees (eventually) on what is the most useful default
          configuration for most of the kernel.
      
        * If it becomes commonplace among kernel developers, clang-format
          may feel compelled to support us better. They already recognize
          the Linux kernel and its style in their documentation and in one
          of the style sub-options.
      
      Some of clang-format's features relevant for the kernel are:
      
        * Uses clang's tooling support behind the scenes to parse and rewrite
          the code. It is not based on ad-hoc regexps.
      
        * Supports reasonably well the Linux kernel coding style.
      
        * Fast enough to be used at the press of a key.
      
        * There are already integrations (either built-in or third-party)
          for many common editors used by kernel developers (e.g. vim,
          emacs, Sublime, Atom...) that allow you to format an entire file
          or, more usefully, just your selection.
      
        * Able to parse unified diffs -- you can, for instance, reformat
          only the lines changed by a git commit.
      
        * Able to reflow text comments as well.
      
        * Widely supported and used by hundreds of developers in highly
          complex projects and organizations (e.g. the LLVM project itself,
          Chromium, WebKit, Google, Mozilla...). Therefore, it will be
          supported for a long time.
      
      See more information about the tool at:
      
          https://clang.llvm.org/docs/ClangFormat.html
          https://clang.llvm.org/docs/ClangFormatStyleOptions.html
      
      Link: http://lkml.kernel.org/r/20180318171632.qfkemw3mwbcukth6@gmail.comSigned-off-by: NMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Andy Whitcroft <apw@canonical.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d4ef8d3f
  7. 21 3月, 2018 1 次提交
  8. 06 6月, 2017 1 次提交
  9. 20 11月, 2016 1 次提交
  10. 08 11月, 2016 1 次提交
  11. 24 10月, 2016 2 次提交
  12. 22 9月, 2016 1 次提交
  13. 21 9月, 2016 5 次提交
  14. 15 8月, 2016 2 次提交
  15. 21 7月, 2016 1 次提交
  16. 26 1月, 2016 1 次提交
  17. 12 1月, 2016 1 次提交
  18. 11 7月, 2015 1 次提交
  19. 08 5月, 2015 1 次提交
  20. 17 4月, 2015 1 次提交
  21. 28 2月, 2015 2 次提交
  22. 29 1月, 2015 1 次提交
  23. 02 12月, 2014 1 次提交
    • D
      CodingStyle: add some more error handling guidelines · ea040360
      Dan Carpenter 提交于
      I added a paragraph on choosing label names, and updated the example
      code to use a better label name.  I also cleaned up the example code to
      more modern style by moving the allocation out of the initializer and
      changing the NULL check.
      
      Perhaps the most common type of error handling bug in the kernel is "one
      err bugs".  CodingStyle already says that we should "avoid nesting" by
      using error labels and one err style error handling tends to have
      multiple indent levels, so this was already bad style.  But I've added a
      new paragraph explaining how to avoid one err bugs by using multiple
      error labels which is, hopefully, more clear.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NJulia Lawall <julia.lawall@lip6.fr>
      [jc: added GFP_KERNEL to kmalloc() call]
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      ea040360
  24. 04 11月, 2014 1 次提交
  25. 26 8月, 2014 1 次提交
  26. 05 6月, 2014 1 次提交
    • D
      Documentation: expand/clarify debug documentation · 6e099f55
      Dan Streetman 提交于
      The pr_debug() and related debug print macros all differ from the normal
      pr_XXX() macros, in that the normal ones print unconditionally, while
      the debug macros are compiled out unless DEBUG is defined or
      CONFIG_DYNAMIC_DEBUG is set.  This isn't obvious, and the only way to
      find this out is either to review the actual printk.h code or to read
      CodingStyle, and the message there doesn't highlight the fact.
      
      Change Documentation/CodingStyle to clearly indicate that pr_debug() and
      related debug printing macros behave differently than all other pr_XXX()
      macros, and attempt to clarify when and where the different debug
      printing methods might be used.
      
      Add short comment to printk.h above the pr_XXX() macros indicating that
      while these macros print unconditionally, pr_debug() does not.
      Signed-off-by: NDan Streetman <ddstreet@ieee.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: Fabian Frederick <fabf@skynet.be>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6e099f55
  27. 04 7月, 2013 1 次提交
  28. 12 1月, 2013 1 次提交
    • K
      Documentation: remove depends on CONFIG_EXPERIMENTAL · 0335cb46
      Kees Cook 提交于
      The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
      while now and is almost always enabled by default. As agreed during the
      Linux kernel summit, remove it from any "depends on" lines in Kconfigs.
      
      CC: Rob Landley <rob@landley.net>
      CC: Jiri Kosina <jkosina@suse.cz>
      CC: Masanari Iida <standby24x7@gmail.com>
      CC: Jason Wessel <jason.wessel@windriver.com>
      CC: Richard L Maliszewski <richard.l.maliszewski@intel.com>
      CC: Gang Wei <gang.wei@intel.com>
      CC: Shane Wang <shane.wang@intel.com>
      CC: Harry Wei <harryxiyou@gmail.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Acked-by: NJason Wessel <jason.wessel@windriver.com>
      0335cb46
  29. 06 10月, 2012 1 次提交
  30. 01 6月, 2012 1 次提交
  31. 31 3月, 2012 1 次提交
  32. 05 11月, 2011 1 次提交
  33. 07 8月, 2011 1 次提交