summaryrefslogtreecommitdiff
path: root/arch/mips/ralink
diff options
context:
space:
mode:
authorNeilBrown <neil@brown.name>2018-03-20 19:29:51 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-28 18:24:27 +0200
commitfb45c56ebd0ffe62f9e45102750c394725d7b2e0 (patch)
treea4c0d8240218ae489c48c10dcd07da8514b7a4ed /arch/mips/ralink
parentde8cdc5572311b0742eccf3c0cfd34af1e105904 (diff)
MIPS: ralink: Remove ralink_halt()
commit 891731f6a5dbe508d12443175a7e166a2fba616a upstream. ralink_halt() does nothing that machine_halt() doesn't already do, so it adds no value. It actually causes incorrect behaviour due to the "unreachable()" at the end. This tells the compiler that the end of the function will never be reached, which isn't true. The compiler responds by not adding a 'return' instruction, so control simply moves on to whatever bytes come afterwards in memory. In my tested, that was the ralink_restart() function. This means that an attempt to 'halt' the machine would actually cause a reboot. So remove ralink_halt() so that a 'halt' really does halt. Fixes: c06e836ada59 ("MIPS: ralink: adds reset code") Signed-off-by: NeilBrown <neil@brown.name> Cc: John Crispin <john@phrozen.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Cc: <stable@vger.kernel.org> # 3.9+ Patchwork: https://patchwork.linux-mips.org/patch/18851/ Signed-off-by: James Hogan <jhogan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/mips/ralink')
-rw-r--r--arch/mips/ralink/reset.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/arch/mips/ralink/reset.c b/arch/mips/ralink/reset.c
index 64543d66e76b..e9531fea23a2 100644
--- a/arch/mips/ralink/reset.c
+++ b/arch/mips/ralink/reset.c
@@ -96,16 +96,9 @@ static void ralink_restart(char *command)
unreachable();
}
-static void ralink_halt(void)
-{
- local_irq_disable();
- unreachable();
-}
-
static int __init mips_reboot_setup(void)
{
_machine_restart = ralink_restart;
- _machine_halt = ralink_halt;
return 0;
}