]> git.baikalelectronics.ru Git - kernel.git/commit
lockdep: make lockdep_assert_held() not have a return value
authorJohannes Berg <johannes.berg@intel.com>
Fri, 22 Feb 2013 00:42:47 +0000 (16:42 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 22 Feb 2013 01:22:19 +0000 (17:22 -0800)
commite893419a930cacc73e93a8225dfd8695d2db1f11
treedcc1e4e8aed9da51a87eca71a8b133a001487381
parent092b259010b76fa9432fa3657907c41e96a53dad
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/lockdep.h