提交 7e5766fa 编写于 作者: D David S. Miller 提交者: David S. Miller

[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: NDavid S. Miller <davem@davemloft.net>
上级 099d575a
...@@ -182,7 +182,9 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign ...@@ -182,7 +182,9 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign
break; break;
default: 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); tte |= pte_sz_bits(page_sz);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册