[PATCH] bogus BUILD_BUG_ON() in bpa_iommu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	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 <[email protected]>
----
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux