Skip to content

Commit

Permalink
[PATCH] bogus BUILD_BUG_ON() in bpa_iommu
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Sep 30, 2005
1 parent 4735885 commit c215a16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/ppc64/kernel/bpa_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c215a16

Please sign in to comment.