Skip to content

Commit

Permalink
checkpatch: warn when declaring "struct spinlock foo;"
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Dec 18, 2012
1 parent 0979ae6 commit 88982fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 88982fe

Please sign in to comment.