From: Al Viro Date: Fri, 30 Sep 2005 02:36:50 +0000 (+0100) Subject: [PATCH] bogus BUILD_BUG_ON() in bpa_iommu X-Git-Tag: v2.6.14-rc3~37 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c215a16a4ad620b612b51495cbb99dbbb59bb585;p=linux-2.6-omap-h63xx.git [PATCH] bogus BUILD_BUG_ON() in bpa_iommu 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 Signed-off-by: Linus Torvalds --- diff --git a/arch/ppc64/kernel/bpa_iommu.c b/arch/ppc64/kernel/bpa_iommu.c index f33a7bccb0d..507eb9d0223 100644 --- a/arch/ppc64/kernel/bpa_iommu.c +++ b/arch/ppc64/kernel/bpa_iommu.c @@ -99,7 +99,11 @@ get_iost_entry(unsigned long iopt_base, unsigned long io_address, unsigned page_ 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; }