Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17d97bad authored by Markos Chandras's avatar Markos Chandras Committed by Ralf Baechle
Browse files

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: default avatarMarkos Chandras <markos.chandras@imgtec.com>
Acked-by: default avatarSteven J. Hill <Steven.Hill@imgtec.com>
Acked-by: default avatarJonas Gorski <jogo@openwrt.org>
Signed-off-by: default avatarJohn Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5932/
parent 68e30f30
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -123,7 +123,9 @@ unsigned int bcm63xx_get_memory_size(void)

static unsigned int detect_cpu_clock(void)
{
	switch (bcm63xx_get_cpu_id()) {
	u16 cpu_id = bcm63xx_get_cpu_id();

	switch (cpu_id) {
	case BCM3368_CPU_ID:
		return 300000000;

@@ -249,7 +251,7 @@ static unsigned int detect_cpu_clock(void)
	}

	default:
		BUG();
		panic("Failed to detect clock for CPU with id=%04X\n", cpu_id);
	}
}