aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-12-17 19:02:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 20:15:19 -0500
commit88982fea52d0115d44b77619afef576f24cdb844 (patch)
treea31942d9f3ec40c520b6c963e726c705e47b7db3 /scripts/checkpatch.pl
parent0979ae66464bd9793c6701861bccb21f9f118a52 (diff)
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/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl6
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 {
3336 "Avoid line continuations in quoted strings\n" . $herecurr); 3336 "Avoid line continuations in quoted strings\n" . $herecurr);
3337 } 3337 }
3338 3338
3339# check for struct spinlock declarations
3340 if ($line =~ /^.\s*\bstruct\s+spinlock\s+\w+\s*;/) {
3341 WARN("USE_SPINLOCK_T",
3342 "struct spinlock should be spinlock_t\n" . $herecurr);
3343 }
3344
3339# Check for misused memsets 3345# Check for misused memsets
3340 if ($^V && $^V ge 5.10.0 && 3346 if ($^V && $^V ge 5.10.0 &&
3341 defined $stat && 3347 defined $stat &&