From: Linus Torvalds Date: Wed, 1 Aug 2007 04:12:07 +0000 (-0700) Subject: Fix WARN_ON() on bitfield ops X-Git-Tag: v2.6.23-rc2~28 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d4fbcfbe0a4bfc73e7f0297c59ae514e1f1436f;p=pandora-kernel.git Fix WARN_ON() on bitfield ops Alexey Dobriyan noticed that the new WARN_ON() semantics that were introduced by commit 684f978347deb42d180373ac4c427f82ef963171 (to also return the value to be warned on) didn't compile when given a bitfield, because the typeof doesn't work for bitfields. So instead of the typeof trick, use an "int" variable together with a "!!(x)" expression, as suggested by Al Viro. To make matters more interesting, Paul Mackerras points out that that is sub-optimal on Power, but the old asm-coded comparison seems to be buggy anyway on 32-bit Power if the conditional was 64-bit, so I think there are more problems there. Regardless, the new WARN_ON() semantics may have been a bad idea. But this at least avoids the more serious complications. Cc: Alexey Dobriyan Cc: Herbert Xu Cc: Paul Mackerras Cc: Al Viro Cc: Ingo Molnar Cc: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed