提交 88982fea 编写于 作者: J Joe Perches 提交者: Linus Torvalds

checkpatch: warn when declaring "struct spinlock foo;"

spinlock_t should always be used.
Signed-off-by: NJoe Perches <joe@perches.com>
Acked-by: N"Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册