Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755364Ab2K2VEE (ORCPT ); Thu, 29 Nov 2012 16:04:04 -0500 Received: from perches-mx.perches.com ([206.117.179.246]:42477 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755191Ab2K2VEC (ORCPT ); Thu, 29 Nov 2012 16:04:02 -0500 Message-ID: <1354223042.1700.3.camel@joe-AO722> Subject: [PATCH] checkpatch: Warn when declaring "struct spinlock foo;" From: Joe Perches To: Andrew Morton Cc: "Luis R. Rodriguez" , linux-kernel@vger.kernel.org Date: Thu, 29 Nov 2012 13:04:02 -0800 In-Reply-To: <1354221910-22493-2-git-send-email-mcgrof@do-not-panic.com> References: <1354221910-22493-1-git-send-email-mcgrof@do-not-panic.com> <1354221910-22493-2-git-send-email-mcgrof@do-not-panic.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.6.0-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 958 Lines: 31 spinlock_t should always be used. Signed-off-by: Joe Perches --- 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 && -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/