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 <>
Acked-by: default avatar"Luis R. Rodriguez" <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
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*;/) {
"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