Tree sweep for spin_is_locked misuses and start warning about it
From: Andi Kleen
Date: Fri Mar 16 2012 - 15:02:39 EST
I did a tree sweep for spin_is_locked() users and many of them were
wrong, got UP incorrect, were obviously racy and had other problems.
I replaced a lot of users with calls to the correct lock debugging functions,
like lockdep_assert_held()
Generally I think spin_is_locked() should be deprecated because it
is rarely used correctly. There are a few legitimate users so we cannot
outright remove it unfortunately.
But most users can be removed or changed.
After this start warning in checkpatch.pl for spin_is_locked() because
it's rarely wrong. Also error out there for the broken
(WARN|BUG)_ON(!spin_is_locked()) which does not work on UP builds.
-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/