From: Joe Perches Date: Tue, 18 Dec 2012 00:02:00 +0000 (-0800) Subject: checkpatch: warn when declaring "struct spinlock foo;" X-Git-Tag: v3.8-rc1~74^2~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88982fea52d0115d44b77619afef576f24cdb844;p=thirdparty%2Fkernel%2Flinux.git checkpatch: warn when declaring "struct spinlock foo;" spinlock_t should always be used. Signed-off-by: Joe Perches Acked-by: "Luis R. Rodriguez" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e0a674f471eed..f27b0b53e3ead 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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 &&