diff options
author | Joe Perches <joe@perches.com> | 2012-12-18 01:02:00 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-18 02:15:19 +0100 |
commit | 88982fea52d0115d44b77619afef576f24cdb844 (patch) | |
tree | a31942d9f3ec40c520b6c963e726c705e47b7db3 /scripts | |
parent | checkpatch: Add --strict messages for blank lines around braces (diff) | |
download | linux-88982fea52d0115d44b77619afef576f24cdb844.tar.xz linux-88982fea52d0115d44b77619afef576f24cdb844.zip |
checkpatch: warn when declaring "struct spinlock foo;"
spinlock_t should always be used.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e0a674f471ee..f27b0b53e3ea 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3336,6 +3336,12 @@ sub process { "Avoid line continuations in quoted strings\n" . $herecurr); } +# check for struct spinlock declarations + if ($line =~ /^.\s*\bstruct\s+spinlock\s+\w+\s*;/) { + WARN("USE_SPINLOCK_T", + "struct spinlock should be spinlock_t\n" . $herecurr); + } + # Check for misused memsets if ($^V && $^V ge 5.10.0 && defined $stat && |