Commit 88982fea52d0115d44b77619afef576f24cdb844

Authored by Joe Perches
Committed by Linus Torvalds
1 parent 0979ae6646

checkpatch: warn when declaring "struct spinlock foo;"

spinlock_t should always be used.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff

scripts/checkpatch.pl
... ... @@ -3336,6 +3336,12 @@
3336 3336 "Avoid line continuations in quoted strings\n" . $herecurr);
3337 3337 }
3338 3338  
  3339 +# check for struct spinlock declarations
  3340 + if ($line =~ /^.\s*\bstruct\s+spinlock\s+\w+\s*;/) {
  3341 + WARN("USE_SPINLOCK_T",
  3342 + "struct spinlock should be spinlock_t\n" . $herecurr);
  3343 + }
  3344 +
3339 3345 # Check for misused memsets
3340 3346 if ($^V && $^V ge 5.10.0 &&
3341 3347 defined $stat &&