[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-08-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp:12 +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include + tmroeder wrote: > tmroeder wrote: > > nickdesaulniers wrote: > > > tmroeder wrote: >

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-26 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked an inline comment as done. tmroeder added inline comments. Comment at: clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp:12 +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include + tmroeder wrote: > nickdesaulniers wrote: > >

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-26 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked an inline comment as done. tmroeder added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:77 + + This is important in the Linux kernel because ``ERR_PTR``, ``PTR_ERR``, + ``IS_ERR``, ``IS_ERR_OR_NULL``, ``ERR_CAST``, and ``PTR_ERR_OR_ZERO``

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-26 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked an inline comment as done. tmroeder added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:77 + + This is important in the Linux kernel because ``ERR_PTR``, ``PTR_ERR``, + ``IS_ERR``, ``IS_ERR_OR_NULL``, ``ERR_CAST``, and ``PTR_ERR_OR_ZERO``

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-26 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:77 + + This is important in the Linux kernel because ``ERR_PTR``, ``PTR_ERR``, + ``IS_ERR``, ``IS_ERR_OR_NULL``, ``ERR_CAST``, and ``PTR_ERR_OR_ZERO`` return tmroeder

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-26 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked an inline comment as done. tmroeder added inline comments. Comment at: clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp:12 +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include + nickdesaulniers wrote: > tmroeder wrote: > >

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-26 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked an inline comment as done. tmroeder added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:77 + + This is important in the Linux kernel because ``ERR_PTR``, ``PTR_ERR``, + ``IS_ERR``, ``IS_ERR_OR_NULL``, ``ERR_CAST``, and ``PTR_ERR_OR_ZERO``

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-25 Thread Tom Roeder via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Revision". This revision was automatically updated to reflect the committed changes. tmroeder marked an inline comment as done. Closed by commit rL367071: [clang-tidy] Add a module for the Linux kernel. (authored by

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-25 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:77 + + This is important in the Linux kernel because ``ERR_PTR``, ``PTR_ERR``, + ``IS_ERR``, ``IS_ERR_OR_NULL``, ``ERR_CAST``, and ``PTR_ERR_OR_ZERO`` return Release

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-25 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers requested changes to this revision. nickdesaulniers added inline comments. This revision now requires changes to proceed. Comment at: clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp:12 +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include +

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-25 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder updated this revision to Diff 211836. tmroeder added a comment. Synchronize the documentation, as requested. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963 Files:

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-25 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked 2 inline comments as done. tmroeder added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:75 + + Checks Linux Kernel code to see if it uses the results from the functions in + linux/err.h. Also checks to see if code uses the results from

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-25 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:75 + + Checks Linux Kernel code to see if it uses the results from the functions in + linux/err.h. Also checks to see if code uses the results from functions that Please

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-25 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder updated this revision to Diff 211783. tmroeder added a comment. Sync'ing to the latest HEAD commit on master. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963 Files:

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-07-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers accepted this revision. nickdesaulniers added a comment. This revision is now accepted and ready to land. In D59963#195 , @dvyukov wrote: > Re more checks. I guess we can borrow some from the existing checkers: >

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-06-24 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. Re more checks. I guess we can borrow some from the existing checkers: https://www.kernel.org/doc/html/v4.12/dev-tools/sparse.html https://bottest.wiki.kernel.org/coccicheck https://lwn.net/Articles/752408/ https://lwn.net/Articles/691882/ They do some checks very well.

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-06-24 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. I assume you tried to run it on the kernel. Please post the current output somewhere. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963

Re: [PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-06-20 Thread Nick Desaulniers via cfe-commits
Sounds like a good start. On Thu, Jun 20, 2019 at 11:55 AM Tom Roeder via Phabricator wrote: > > tmroeder marked an inline comment as done. > tmroeder added inline comments. > > > > Comment at: clang-tools-extra/test/clang-tidy/linuxkernel-must-check-errs.c:6 > +// Prototypes of

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-06-20 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked an inline comment as done. tmroeder added inline comments. Comment at: clang-tools-extra/test/clang-tidy/linuxkernel-must-check-errs.c:6 +// Prototypes of the error functions. +void * __must_check ERR_PTR(long error); +long __must_check PTR_ERR(const void *ptr);

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-06-11 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. See also: https://github.com/ClangBuiltLinux/linux/issues/520 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963 ___ cfe-commits

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-06-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang-tools-extra/test/clang-tidy/linuxkernel-must-check-errs.c:6 +// Prototypes of the error functions. +void * __must_check ERR_PTR(long error); +long __must_check PTR_ERR(const void *ptr); Let's come up with

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp:24 + "ERR_CAST", "PTR_ERR_OR_ZERO")); + auto NonCheckingStmts = stmt(anyOf(compoundStmt(), labelStmt())); + Finder->addMatcher(

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/linuxkernel-must-use-errs.rst:10 +functions are marked with ``__attribute__((warn_unused_result))``, but +the compiler warning for this attribute is not always enabled. +

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-23 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder updated this revision to Diff 196273. tmroeder added a comment. Remove an unnecessary header and fix the error text. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963 Files:

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-23 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked 5 inline comments as done. tmroeder added a comment. Thanks to everyone for the comments. I've answered them as best I can, and I'm definitely open to changes or to scrapping this entirely. I should have prefixed this patch with a discussion on the main list, perhaps. My main

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/linuxkernel-must-use-errs.rst:10 +functions are marked with ``__attribute__((warn_unused_result))``, but +the compiler warning for this attribute is not always enabled. + IIRC

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp:39 + if (MatchedCallExpr && + MatchedCallExpr->hasUnusedResultAttr(*Result.Context)) { +diag(MatchedCallExpr->getExprLoc(), "Unused result from error

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp:12 +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include + This looks wrong Comment at:

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-22 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked an inline comment as done. tmroeder added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:148 + + FIXME: add release notes. + Eugene.Zelenko wrote: > Please add short description. Should be same as first statements in >

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-22 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder updated this revision to Diff 196151. tmroeder added a comment. Fix a line-length issue in the check code and rewrite the doc text. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963 Files:

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-22 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder updated this revision to Diff 196150. tmroeder added a comment. Actually add the documentation in the release notes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963 Files:

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-22 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:148 + + FIXME: add release notes. + Please add short description. Should be same as first statements in documentation. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-22 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder updated this revision to Diff 196148. tmroeder marked an inline comment as done. tmroeder added a comment. Updated with an initial check. Verified that add_new_check.py works (that's how I added the check). Also added some basic docs and a test. Repository: rG LLVM Github Monorepo

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-04-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Can you verify that the add_new_check.py script works fine with this new module? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-03-29 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder updated this revision to Diff 192860. tmroeder added a comment. Changed the module name to linuxkernel as suggested and updated the files to match. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-03-29 Thread Tom Roeder via Phabricator via cfe-commits
tmroeder marked 2 inline comments as done. tmroeder added a comment. In D59963#1447985 , @alexfh wrote: > Looks reasonable in general, but we usually add modules with at least one > check. Let's do the same here. OK, will do.