diff options
author | Jan Beulich <JBeulich@novell.com> | 2009-09-22 19:43:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:29 -0400 |
commit | 8c87df457cb58fe75b9b893007917cf8095660a0 (patch) | |
tree | 32446b329e4b83ae6158fa1505c36634a75dbfe8 /drivers/net/niu.c | |
parent | 1fe72eaa0f46a0fa4cdcd8f3f7853b6d39469784 (diff) |
BUILD_BUG_ON(): fix it and a couple of bogus uses of it
gcc permitting variable length arrays makes the current construct used for
BUILD_BUG_ON() useless, as that doesn't produce any diagnostic if the
controlling expression isn't really constant. Instead, this patch makes
it so that a bit field gets used here. Consequently, those uses where the
condition isn't really constant now also need fixing.
Note that in the gfp.h, kmemcheck.h, and virtio_config.h cases
MAYBE_BUILD_BUG_ON() really just serves documentation purposes - even if
the expression is compile time constant (__builtin_constant_p() yields
true), the array is still deemed of variable length by gcc, and hence the
whole expression doesn't have the intended effect.
[akpm@linux-foundation.org: make arch/sparc/include/asm/vio.h compile]
[akpm@linux-foundation.org: more nonsensical assertions in tpm.c..]
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Cc: Mimi Zohar <zohar@us.ibm.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r-- | drivers/net/niu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 76cc2614f480..f9364d0678f2 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -5615,7 +5615,7 @@ static void niu_init_tx_mac(struct niu *np) | |||
5615 | /* The XMAC_MIN register only accepts values for TX min which | 5615 | /* The XMAC_MIN register only accepts values for TX min which |
5616 | * have the low 3 bits cleared. | 5616 | * have the low 3 bits cleared. |
5617 | */ | 5617 | */ |
5618 | BUILD_BUG_ON(min & 0x7); | 5618 | BUG_ON(min & 0x7); |
5619 | 5619 | ||
5620 | if (np->flags & NIU_FLAGS_XMAC) | 5620 | if (np->flags & NIU_FLAGS_XMAC) |
5621 | niu_init_tx_xmac(np, min, max); | 5621 | niu_init_tx_xmac(np, min, max); |