[PATCH] bogus BUILD_BUG_ON() in bpa_iommu

From: Al Viro (viro_at_ftp.linux.org.uk)
Date: 09/30/05

  • Next message: Mark Knecht: "Re: l2.6.14-rc2-rt7 - build problems - mce?"
    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/
    

  • Next message: Mark Knecht: "Re: l2.6.14-rc2-rt7 - build problems - mce?"

    Relevant Pages