aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2013-09-30 04:38:00 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-01-24 16:39:52 -0500
commit17d97bad1ab966f1f39b10c48cd3f858a29b3659 (patch)
tree13e6e00503a1ae72d54622cbffcd9fd213f987b9 /arch/mips
parent68e30f30875d4e4608cebec27ca8bd07be0d0f64 (diff)
MIPS: bcm63xx: cpu: Replace BUG() with panic()
BUG() can be a noop if CONFIG_BUG is not selected, leading to the following build problem on a randconfig: arch/mips/bcm63xx/cpu.c: In function 'detect_cpu_clock': arch/mips/bcm63xx/cpu.c:254:1: error: control reaches end of non-void function [-Werror=return-type] We fix this problem by replacing BUG() with panic() since it's best to handle the case of an unknown board instead of silently returning a random clock frequency. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Acked-by: Steven J. Hill <Steven.Hill@imgtec.com> Acked-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/5932/
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/bcm63xx/cpu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c
index b713cd64b087..1b1b8a89959b 100644
--- a/arch/mips/bcm63xx/cpu.c
+++ b/arch/mips/bcm63xx/cpu.c
@@ -123,7 +123,9 @@ unsigned int bcm63xx_get_memory_size(void)
123 123
124static unsigned int detect_cpu_clock(void) 124static unsigned int detect_cpu_clock(void)
125{ 125{
126 switch (bcm63xx_get_cpu_id()) { 126 u16 cpu_id = bcm63xx_get_cpu_id();
127
128 switch (cpu_id) {
127 case BCM3368_CPU_ID: 129 case BCM3368_CPU_ID:
128 return 300000000; 130 return 300000000;
129 131
@@ -249,7 +251,7 @@ static unsigned int detect_cpu_clock(void)
249 } 251 }
250 252
251 default: 253 default:
252 BUG(); 254 panic("Failed to detect clock for CPU with id=%04X\n", cpu_id);
253 } 255 }
254} 256}
255 257