]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: improve blank line after declaration test
authorJoe Perches <joe@perches.com>
Fri, 26 Feb 2021 01:21:40 +0000 (17:21 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Feb 2021 17:41:04 +0000 (09:41 -0800)
commit8b47a819b5ab75770c5dd8b9c9a1c4344cb4b9a5
tree355298db478d268e8b2be244c0098eee26b33dd8
parente89ba8b521b07de77f830716e44acb3a0264f06b
checkpatch: improve blank line after declaration test

Avoid multiple false positives by ignoring attributes.

Various attributes like volatile and ____cacheline_aligned_in_smp cause
checkpatch to emit invalid "Missing a blank line after declarations"
messages.

Use copies of $sline and $prevline, remove $Attribute and $Sparse, and use
the existing tests to avoid these false positives.

Miscellanea:

o Add volatile to $Attribute

This also reduces checkpatch runtime a bit by moving the indentation
comparison test to the start of the block to avoid multiple unnecessary
regex tests.

Link: https://lkml.kernel.org/r/9015fd00742bf4e5b824ad6d7fd7189530958548.camel@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl