From: Johannes Berg Date: Fri, 22 Feb 2013 00:42:47 +0000 (-0800) Subject: lockdep: make lockdep_assert_held() not have a return value X-Git-Tag: v3.9-rc1~114^2~119 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1ae345d971664f70cfdc293029c40ccfb093591;p=pandora-kernel.git 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 Cc: Peter Zijlstra Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed