[PATCH] bogus BUILD_BUG_ON() in bpa_iommu
From: Al Viro (viro_at_ftp.linux.org.uk)
Date: 09/30/05
- Previous message: zhuang zhuanghou: "How can I control the network package"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Sep 2005 03:36:50 +0100 To: Linus Torvalds <torvalds@osdl.org>
BUILD_BUG_ON(1) is asking for trouble (and getting it) when used
in that manner - dead code elimination happens after we parse it and
invalid type is invalid type, dead code or not.
It might be version-dependent, but at least 4.0.1 refuses to
accept that.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
----
diff -urN RC14-rc2-git6-base/arch/ppc64/kernel/bpa_iommu.c current/arch/ppc64/kernel/bpa_iommu.c
--- RC14-rc2-git6-base/arch/ppc64/kernel/bpa_iommu.c 2005-09-26 00:02:29.000000000 -0400
+++ current/arch/ppc64/kernel/bpa_iommu.c 2005-09-15 14:22:33.000000000 -0400
@@ -99,7 +99,11 @@
break;
default: /* not a known compile time constant */
- BUILD_BUG_ON(1);
+ {
+ /* BUILD_BUG_ON() is not usable here */
+ extern void __get_iost_entry_bad_page_size(void);
+ __get_iost_entry_bad_page_size();
+ }
break;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: zhuang zhuanghou: "How can I control the network package"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: [2.6 patch] sound/oss/rme96xx.c: fix two check after use
... If there are checks, they should be there for a purpose, and any sane ... If
they are dead code, ... could provide the correct fix. ... send the line
"unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: [PATCH] ARCH_HAS_IRQ_PER_CPU avoids dead code in __do_IRQ()
... > Then just leave the code as is and let GCC optimize the dead code ... lets
readers of __do_IRQimmediately grasp: ... And you'll get compile error's using IRQ_PER_CPU
on ie i386, ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: [linux-usb-devel] Re: [2.6 patch] usbnet.c: remove an unused function
... >> generated, no warnings. ... ACK, kill this dead code ...
no response, treated as an ACK. ... send the line "unsubscribe linux-kernel" in
... (Linux-Kernel) - Re: [PATCH] kernel 2.6.11.6 - I2C adaptor for ColdFire 5282 CPU
... Changelogs are not welcome in kernel code. ... Please don't include dead
code. ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: [PATCH 5/6] 2.6.7-mm1, remove unused ASUS K7V-RM DMI quirk
... > Maybe CC Len Brown on this, to see if he screams? ... Dead code,
go ahead and clean it out. ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel)