]> git.karo-electronics.de Git - karo-tx-linux.git/commit
lockdep: make lockdep_assert_held() not have a return value
authorJohannes Berg <johannes.berg@intel.com>
Wed, 20 Feb 2013 02:13:51 +0000 (13:13 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:15 +0000 (16:52 +1100)
commit250cff7d6aabf3fd44cabcaaec555e1b8e63533b
treeccaf6ea694e33b005ef9edb0cd41440c9639131e
parentf53ffa295cc738dfa7458e1d30c5633a691b0743
lockdep: make lockdep_assert_held() not have a return value

I recently made the mistake of writing:

foo = lockdep_dereference_protected(..., lockdep_assert_held(...));

which is clearly bogus.  If lockdep is disabled in the config this would
cause a compile failure, if it is enabled then it compiles and causes a
puzzling warning about dereferencing without the correct protection.

Wrap the macro in "do { ...  } while (0)" to also fail compile for this
when lockdep is enabled.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/lockdep.h