diff options
author | David S. Miller <davem@bnsf.davemloft.net> | 2007-10-29 03:36:09 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-31 18:30:52 -0400 |
commit | 7e5766fa9431602ef0e56ceae900d0cce3a78b96 (patch) | |
tree | 503f4ee5a97cabaa066bedcb8891b45e253e5128 /arch/sparc64/mm/tsb.c | |
parent | 099d575aaf3dcf4c9c1e0b53c7b17c5faddb1b59 (diff) |
[SPARC64]: Fix build failure when CONFIG_BUG is disabled.
When CONFIG_BUG is turned off, the standard trick of:
switch (x) {
case X:
...
case Y:
...
default:
BUG();
};
to mark impossible cases does not work because BUG() evalutes
to nothing and thus GCC just sees a fallthrough code path.
Add an explicit KERN_ERR log message and a do_exit() to trap
this case.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/mm/tsb.c')
-rw-r--r-- | arch/sparc64/mm/tsb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/sparc64/mm/tsb.c b/arch/sparc64/mm/tsb.c index 7ff0a02f5813..a3e6e4b635b3 100644 --- a/arch/sparc64/mm/tsb.c +++ b/arch/sparc64/mm/tsb.c | |||
@@ -182,7 +182,9 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign | |||
182 | break; | 182 | break; |
183 | 183 | ||
184 | default: | 184 | default: |
185 | BUG(); | 185 | printk(KERN_ERR "TSB[%s:%d]: Impossible TSB size %lu, killing process.\n", |
186 | current->comm, current->pid, tsb_bytes); | ||
187 | do_exit(SIGSEGV); | ||
186 | }; | 188 | }; |
187 | tte |= pte_sz_bits(page_sz); | 189 | tte |= pte_sz_bits(page_sz); |
188 | 190 | ||