mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] checkpatch: Warn when declaring "struct spinlock foo;"
Date: Thu, 29 Nov 2012 13:04:02 -0800	[thread overview]
Message-ID: <1354223042.1700.3.camel@joe-AO722> (raw)
In-Reply-To: <1354221910-22493-2-git-send-email-mcgrof@do-not-panic.com>

spinlock_t should always be used.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e0a674f..f27b0b5 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 &&



  reply	other threads:[~2012-11-29 21:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 20:45 [PATCH 0/6] drivers: convert struct spinlock to spinlock_t Luis R. Rodriguez
2012-11-29 20:45 ` [PATCH 1/6] ux500: " Luis R. Rodriguez
2012-11-29 21:04   ` Joe Perches [this message]
2012-12-01 18:11   ` Linus Walleij
2012-11-29 20:45 ` [PATCH 2/6] i915: " Luis R. Rodriguez
2012-11-29 20:49   ` Daniel Vetter
2012-11-29 20:45 ` [PATCH 3/6] s5p-fimc: " Luis R. Rodriguez
2012-11-29 20:45 ` [PATCH 4/6] s5p-jpeg: " Luis R. Rodriguez
2012-11-29 20:45 ` [PATCH 5/6] brcmfmac: " Luis R. Rodriguez
2012-11-29 20:45 ` [PATCH 6/6] ie6xx_wdt: " Luis R. Rodriguez
2012-11-30  8:38 ` [PATCH 0/6] drivers: " Arend van Spriel
2012-11-30 19:18   ` Luis R. Rodriguez
2012-11-30 20:25     ` Luis R. Rodriguez
2012-11-30 21:21       ` Arend van Spriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354223042.1700.3.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@do-not-panic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®