Received: by 10.213.65.68 with SMTP id h4csp219921imn; Tue, 20 Mar 2018 01:32:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELupG/jYs0eeGIIeinwjIiNDu1PDxgviCb/6P8HTnbpKbZF2UsQ7GJ+ks55ObTyoZE3jnpD9 X-Received: by 10.101.82.12 with SMTP id o12mr11412327pgp.126.1521534766245; Tue, 20 Mar 2018 01:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521534766; cv=none; d=google.com; s=arc-20160816; b=igDpJQ0G6GGtnoravvd7HCYpHOaus0w7nACc2tvXsJ/bhAhMiKxnCkqFWdWbyIoPg8 3AbopuQqHPFXG0ONcekSp1pNLs4tDPPUCmVZok40+ajCyPJSQau0soaw6ugU794OFlSv Lql07FsG8gGdFSxW5kDyOab0PjlV+yTQISVg6J7p82cujA/wPXuYkKzotZRV7daA/j9s PxZYNtplsG2upxEYFI6CS1ks2rnUf6qzSv4I8bob0nu4glDfeQEycyPCvOXzwC/bbKjq A5B5mpfeXHBaG3RcD5eT7GSUxM+ha5N3rrMrnigS1tsC04XIcAOgREGALXXsB95Pps6B PFdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:subject:cc:date :to:from:arc-authentication-results; bh=P6nDkZ4dQvFZ+ZJ1q+7VNx+kcEuttgCTMTELBsXpRQI=; b=fjc0YY2n4OrMPnMyYUBJbt6I6ovefpyyuBULpuBx6SvFrgzBLDEUhH+EbGmwI5/jGf tWjarxA5hnOO2aMFy3/79wY8rN8+dKbO1fM3BDjfG4hRXcrGPlCuQh2YbnfIA02kmxRv m2iuyhBokNRK3m0SaTnfKuaH/MuBsob18dAFyK8+EyrDWDXwnBgMGtuuV+DlYymybSWU Sdw7/vfDgg926D6dDtFK3o6Se7CCom28jQ8uT1lEBEOzkN5gW1RMMUjopbRkvT4UjT97 0KzRjtNvmDn9zDX5dgy5GwHRWRoMj1mBm9WrY2dqTFUJuX1p/LVAJr3ZZQsZMVmC56+I w9aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g23-v6si1099877plo.697.2018.03.20.01.32.29; Tue, 20 Mar 2018 01:32:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751861AbeCTIaA (ORCPT + 99 others); Tue, 20 Mar 2018 04:30:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:38205 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751450AbeCTI37 (ORCPT ); Tue, 20 Mar 2018 04:29:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4B31EAC57; Tue, 20 Mar 2018 08:29:58 +0000 (UTC) From: NeilBrown To: John Crispin , Ralf Baechle , James Hogan Date: Tue, 20 Mar 2018 19:29:51 +1100 Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: ralink: remove ralink_halt() Message-ID: <87370v9mkg.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 tell 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. Signed-off-by: NeilBrown =2D-- arch/mips/ralink/reset.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/arch/mips/ralink/reset.c b/arch/mips/ralink/reset.c index 64543d66e76b..e9531fea23a2 100644 =2D-- a/arch/mips/ralink/reset.c +++ b/arch/mips/ralink/reset.c @@ -96,16 +96,9 @@ static void ralink_restart(char *command) unreachable(); } =20 =2Dstatic void ralink_halt(void) =2D{ =2D local_irq_disable(); =2D unreachable(); =2D} =2D static int __init mips_reboot_setup(void) { _machine_restart =3D ralink_restart; =2D _machine_halt =3D ralink_halt; =20 return 0; } =2D-=20 2.14.0.rc0.dirty --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAlqwxn8ACgkQOeye3VZi gblkLRAAvwG8WkRAE1caLZ1sbk1UVbj6WvbgJ0g0F6mxky+8sWif0kKsTyOqBSzM HeR1bw2n4N+IAqgX8EilcO6L2h0tFT60kgZeMFabR9z2S9i1rX7cv7xvF/cmQOiz 84LejiQHNxpFZ8QRrOaRSI+H5D4qxac2hiwrzO60XinEjPKCGoavmXtiWld9Tn7O 3C8OI+t1pEwH3PHSZcD57l5z7HURGnGP9evrl0xvzm523YJiK+HGOnhE/TdHTKLN mggnBSNKV0hgmIIuMXkv4zu+TbLq8WR/hs8nNLsOSATLayjXDTrwzn63E0tVjjUE HZy3t6ZjU+Dud9fFoRkhqMm0kfC9/tCW+oW0EwXM6rJLWRD3wZqNRhfxdlN6Xh8X bXBsAP0LcbrSNj3jlXxhWbMeYTaVtu2R/ZkDkSq4e6JASp1Ly+5AfEpemMJzCyiR 6i4EAh2PdRdYNteKfMMXb3/s6IBmbYQjE9D2ZVptiDi8o0blW+EejKcXsbLqMsmc gVV3Pa4m0dEF96+TV6lWv8ypr/wGf92kDMum7/A6odcBnKtPRv+gsVIOggf3F9RU sqvL2GBUEth+G/IYyVh0/o1P33kcJjjbRLXjOAi0c6BKGARkNwP1EpTmbUiwAnY7 jK4jJbsVbPMvG6d2cCxOe1uMGSh/ngO+Kd+lKvP1JPXloxuU11o= =Rhh6 -----END PGP SIGNATURE----- --=-=-=--