From: Joe Perches Date: Tue, 18 Dec 2012 00:02:00 +0000 (-0800) Subject: checkpatch: warn when declaring "struct spinlock foo;" X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=88982fea52d0115d44b77619afef576f24cdb844;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 e0a674f471ee..f27b0b53e3ea 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 &&