void added inline comments.

================
Comment at: clang-tools-extra/clang-tidy/linuxkernel/LogFunctionsCheck.cpp:51
+void LogFunctionsCheck::check(const MatchFinder::MatchResult &Result) {
+  if (FixerKind == LFFK_H) {
+    const auto *Call = Result.Nodes.getNodeAs<CallExpr>("call");
----------------
For future reference, Clang / LLVM normally likes to limit the amount of 
indentation that's due to checks like these. So early exit like this:

```
void LogFunctionsCheck::check(const MatchFinder::MatchResult &Result) {
  if (FixerKind != LFFK_H)
    return;

  ... // Fixer code here.
```

But I agree with @njames93 that you probably don't need the enum right now.


================
Comment at: clang-tools-extra/clang-tidy/linuxkernel/LogFunctionsCheck.cpp:53
+    const auto *Call = Result.Nodes.getNodeAs<CallExpr>("call");
+    const auto *Function = Result.Nodes.getNodeAs<FunctionDecl>("func");
+    const auto *Literal = Result.Nodes.getNodeAs<StringLiteral>("lit");
----------------
It might be worthwhile to name `Function` something like `Printk` so that the 
code can be more self-documenting. (Also change the bound variable from `func` 
to `printk`.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93182/new/

https://reviews.llvm.org/D93182

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to