Commit 88982fea authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

checkpatch: warn when declaring "struct spinlock foo;"



spinlock_t should always be used.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatar"Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0979ae66
......@@ -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 &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment