Skip to content

Commit

Permalink
[SPARC64]: Fix build failure when CONFIG_BUG is disabled.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller authored and David S. Miller committed Oct 31, 2007
1 parent 099d575 commit 7e5766f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/sparc64/mm/tsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7e5766f

Please sign in to comment.