dect
/
linux-2.6
Archived
13
0
Fork 0

[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>
This commit is contained in:
David S. Miller 2007-10-29 00:36:09 -07:00 committed by David S. Miller
parent 099d575aaf
commit 7e5766fa94
1 changed files with 3 additions and 1 deletions

View File

@ -182,7 +182,9 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign
break;
default:
BUG();
printk(KERN_ERR "TSB[%s:%d]: Impossible TSB size %lu, killing process.\n",
current->comm, current->pid, tsb_bytes);
do_exit(SIGSEGV);
};
tte |= pte_sz_bits(page_sz);