Skip to content

Makefile: filter the __cleanup_* false positive from checkpatch - #4127

Merged
igaw merged 2 commits into
linux-nvme:masterfrom
martin-belanger:checkpatch-filter
Oct 7, 2026
Merged

igaw merged 2 commits into
linux-nvme:masterfrom
martin-belanger:checkpatch-filter

Conversation

@martin-belanger

Copy link
Copy Markdown
Collaborator

checkpatch does not recognize _cleanup* declarations as variable declarations and reports "Missing a blank line after declarations". Filter this warning in "make checkpatch" and "make checkpatch-diff", as #4114 does for CI. The filter is a script so that CI can use the same copy.

@dwsuse

dwsuse commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Could we use the same filter script for the CI build? Reducing duplication and have a single place to add more filtering if needed. Ah the other commit is not yet in. In this case just

EDIT: the original commit is not in yet. Just cherry pick it from my series and add this feature here. I'll drop it from the other series then

@martin-belanger

Copy link
Copy Markdown
Collaborator Author

Yes. And I commented in PR #4114 that we should do that.

@dwsuse

dwsuse commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Sorry for the confusion, I didn't see the comment in the other PR.

igaw and others added 2 commits October 7, 2026 09:52
checkpatch doesn't recognize __cleanup_* declarations (__cleanup_free,
__cleanup_fd, ...) as variable declarations, so it misreports
"Missing a blank line after declarations" whenever one sits next to
another declaration. This is a known, recurring false positive, not a
real style issue, and it fails the checkpatch job on any PR that adds
adjacent __cleanup_* declarations.

Filter that specific warning out of checkpatch's output before
deciding pass/fail, instead of ignoring checkpatch's own exit code.

Signed-off-by: Daniel Wagner <wagi@monom.org>
Move the CI filter into scripts/checkpatch-filter.pl. CI,
"make checkpatch" and "make checkpatch-diff" now use the same copy.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
@igaw
igaw merged commit 1cb15e5 into linux-nvme:master Oct 7, 2026
33 checks passed
@igaw

igaw commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants