mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, Peter Zijlstra <peterz@infradead.org>
Subject: [patch 9/9] locking: Remove deprecated lock initializers
Date: Sun, 23 Jan 2011 15:17:36 -0000	[thread overview]
Message-ID: <20110123143837.697467914@linutronix.de> (raw)
In-Reply-To: <20110123143631.392446736@linutronix.de>

[-- Attachment #1: locking-remove-deprecated-lock-initializers.patch --]
[-- Type: text/plain, Size: 3421 bytes --]

Last users are gone. Remove the leftovers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 Documentation/spinlocks.txt    |   24 +-----------------------
 include/linux/rwlock_types.h   |    8 --------
 include/linux/spinlock_types.h |    8 --------
 scripts/checkpatch.pl          |    5 -----
 4 files changed, 1 insertion(+), 44 deletions(-)

Index: linux-2.6/Documentation/spinlocks.txt
===================================================================
--- linux-2.6.orig/Documentation/spinlocks.txt
+++ linux-2.6/Documentation/spinlocks.txt
@@ -86,7 +86,7 @@ to change the variables it has to get an
 
 The routines look the same as above:
 
-   rwlock_t xxx_lock = RW_LOCK_UNLOCKED;
+   rwlock_t xxx_lock = __RW_LOCK_UNLOCKED(xxx_lock);
 
 	unsigned long flags;
 
@@ -196,25 +196,3 @@ appropriate:
 
 For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or
 __SPIN_LOCK_UNLOCKED() / __RW_LOCK_UNLOCKED() as appropriate.
-
-SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated.  These interfere
-with lockdep state tracking.
-
-Most of the time, you can simply turn:
-	static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED;
-into:
-	static DEFINE_SPINLOCK(xxx_lock);
-
-Static structure member variables go from:
-
-	struct foo bar {
-		.lock	=	SPIN_LOCK_UNLOCKED;
-	};
-
-to:
-
-	struct foo bar {
-		.lock	=	__SPIN_LOCK_UNLOCKED(bar.lock);
-	};
-
-Declaration of static rw_locks undergo a similar transformation.
Index: linux-2.6/include/linux/rwlock_types.h
===================================================================
--- linux-2.6.orig/include/linux/rwlock_types.h
+++ linux-2.6/include/linux/rwlock_types.h
@@ -43,14 +43,6 @@ typedef struct {
 				RW_DEP_MAP_INIT(lockname) }
 #endif
 
-/*
- * RW_LOCK_UNLOCKED defeat lockdep state tracking and is hence
- * deprecated.
- *
- * Please use DEFINE_RWLOCK() or __RW_LOCK_UNLOCKED() as appropriate.
- */
-#define RW_LOCK_UNLOCKED	__RW_LOCK_UNLOCKED(old_style_rw_init)
-
 #define DEFINE_RWLOCK(x)	rwlock_t x = __RW_LOCK_UNLOCKED(x)
 
 #endif /* __LINUX_RWLOCK_TYPES_H */
Index: linux-2.6/include/linux/spinlock_types.h
===================================================================
--- linux-2.6.orig/include/linux/spinlock_types.h
+++ linux-2.6/include/linux/spinlock_types.h
@@ -81,14 +81,6 @@ typedef struct spinlock {
 #define __SPIN_LOCK_UNLOCKED(lockname) \
 	(spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname)
 
-/*
- * SPIN_LOCK_UNLOCKED defeats lockdep state tracking and is hence
- * deprecated.
- * Please use DEFINE_SPINLOCK() or __SPIN_LOCK_UNLOCKED() as
- * appropriate.
- */
-#define SPIN_LOCK_UNLOCKED	__SPIN_LOCK_UNLOCKED(old_style_spin_init)
-
 #define DEFINE_SPINLOCK(x)	spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
 
 #include <linux/rwlock_types.h>
Index: linux-2.6/scripts/checkpatch.pl
===================================================================
--- linux-2.6.orig/scripts/checkpatch.pl
+++ linux-2.6/scripts/checkpatch.pl
@@ -2654,11 +2654,6 @@ sub process {
 			WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
 		}
 
-# SPIN_LOCK_UNLOCKED & RW_LOCK_UNLOCKED are deprecated
-		if ($line =~ /\b(SPIN_LOCK_UNLOCKED|RW_LOCK_UNLOCKED)/) {
-			ERROR("Use of $1 is deprecated: see Documentation/spinlocks.txt\n" . $herecurr);
-		}
-
 # warn about #if 0
 		if ($line =~ /^.\s*\#\s*if\s+0\b/) {
 			CHK("if this code is redundant consider removing it\n" .



  parent reply	other threads:[~2011-01-23 15:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-23 15:16 [patch 0/9] locking: Remove the " Thomas Gleixner
2011-01-23 15:16 ` [patch 1/9] alpha: Replace deprecated spinlock initialization Thomas Gleixner
2011-01-23 17:07   ` Matt Turner
2011-01-27  7:54     ` Thomas Gleixner
2011-01-23 15:16 ` [patch 2/9] cris: " Thomas Gleixner
2011-01-24 10:54   ` Jesper Nilsson
2011-01-27  7:54     ` Thomas Gleixner
2011-01-23 15:17 ` [patch 3/9] mips: " Thomas Gleixner
     [not found]   ` <20110124124215.GA3133@linux-mips.org>
2011-01-27  7:54     ` Thomas Gleixner
2011-01-23 15:17 ` [patch 4/9] sparc: " Thomas Gleixner
2011-01-23 19:54   ` David Miller
2011-01-23 15:17 ` [patch 5/9] um: " Thomas Gleixner
2011-01-23 15:17 ` [patch 6/9] xtensa: " Thomas Gleixner
2011-01-23 15:17 ` [patch 7/9] kthread: " Thomas Gleixner
2011-01-23 15:17 ` [patch 8/9] cred: " Thomas Gleixner
2011-01-23 15:17 ` Thomas Gleixner [this message]
2011-01-24  9:46 ` [patch 0/9] locking: Remove the deprecated lock initializers Peter Zijlstra

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=20110123143837.697467914@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /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®