DEFINE_FREE() macros tend to include conditions, and checkpatch likes to
complain:
WARNING: suspect code indent for conditional statements (0, 0)
#77: FILE: drivers/pci/tsm.c:77:
+DEFINE_FREE(tsm_remove, struct pci_tsm *, if (_T) tsm_remove(_T))
[...]
+static void pci_tsm_walk_fns(struct pci_dev *pdev,
Suppress these warnings.
Closes: https://lore.kernel.org/all/68ed99a5b6308_1992810024@dwillia2-mobl4.notmuch/
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
scripts/checkpatch.pl | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b7a42bbdd94..45df5071541d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4441,7 +4441,10 @@ sub process {
}
# Check relative indent for conditionals and blocks.
- if ($line =~ /\b(?:(?:if|while|for|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|(?:do|else)\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
+ if ($line =~ /\b(?:(?:if|while|for|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|(?:do|else)\b)/ &&
+ $line !~ /^.\s*#/ &&
+ $line !~ /\}\s*while\s*/ &&
+ $line !~ /\bDEFINE_FREE\(/) {
($stat, $cond, $line_nr_next, $remain_next, $off_next) =
ctx_statement_block($linenr, $realcnt, 0)
if (!defined $stat);
--
2.55.0.141.g00534a21ce-goog