tmroeder added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/linuxkernel/LinuxKernelTidyModule.cpp:25 "linuxkernel-must-check-errs"); + CheckFactories.registerCheck<SwitchSemiCheck>( + "linuxkernel-switch-semi"); ---------------- Please fix the linter error, here and in the other cases. ================ Comment at: clang-tools-extra/clang-tidy/linuxkernel/SwitchSemiCheck.cpp:34 + if (const auto *N = dyn_cast<NullStmt>(*Next)) { + if (!N->hasLeadingEmptyMacro() && S->getBody()->getEndLoc().isValid() && + N->getSemiLoc().isValid()) { ---------------- nit: I could use a short comment about the reason for this check for hasLeadingEmptyMacro. ================ Comment at: clang-tools-extra/test/clang-tidy/checkers/linuxkernel-switch-semi.c:4-9 + switch (a) { + case 1: + return 0; + default: + break; + }; ---------------- Maybe also a test that shows that it doesn't apply to a normal switch statement (without the extra semicolon)? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90180/new/ https://reviews.llvm.org/D90180 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits