Skip to content

Commit 88982fe

Browse files
JoePerchestorvalds
authored andcommitted
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>
1 parent 0979ae6 commit 88982fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/checkpatch.pl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3336,6 +3336,12 @@ sub process {
33363336
"Avoid line continuations in quoted strings\n" . $herecurr);
33373337
}
33383338

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+
33393345
# Check for misused memsets
33403346
if ($^V && $^V ge 5.10.0 &&
33413347
defined $stat &&

0 commit comments

Comments
 (0)