]> 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>
Thu, 7 Feb 2013 01:26:03 +0000 (12:26 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:46:11 +0000 (16:46 +1100)
commit0448e3787408701506743697fb4663a6ed1e8db6
tree3cdf1f132cc12531b1658b6077ef86d9eac17be6
parentb2e5c7cfd18d4984939412be30648c692ec3bfe1
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