Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2460635imm; Thu, 7 Jun 2018 10:58:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJHOEmxWZbEejgI/PIy6FWpDuLr8fr3OK02GwYx68w9yz7+OgIc0SpkVJQQ+oerR0zFRsSj X-Received: by 2002:a17:902:be03:: with SMTP id r3-v6mr3071251pls.319.1528394337684; Thu, 07 Jun 2018 10:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528394337; cv=none; d=google.com; s=arc-20160816; b=BThGzQHvH8rx9lBv6phqN3qaohtWDny6r1MyfXqQi3oxd9uyT8y4mqwDQVYOukI7y5 eCkyIijv2OX7nu4XbcbwizLfPJBpO/8ZpqOGB4UOOct58W6soi+Hk22+5Foarixb7fNL 30dbX6BouSt3vux7JekWXEPg/IWQ/myVYVrJv5GpX8xhlphCP+VcKrLEu4duB+50YFvM CPS17PrBLvG4SwtmZKZXy7RvcoR4hPx6IjCifAi+HXrzbjmfF2iTedaulV3IyzC4s/OX 9LpduyoaGhLAF8WSx11dCM+fBpQfVi40dVzwCasRgE/efxMixN3MNxDT6485xdAqzk+T 6SWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=WkXMR8K1OSeQLdGp4N5f23zs1oSCwfxQQtOhKS9NJOY=; b=xPtC5yq1nIxs6XH/BFA4lfXR9pYvHRz7zGHomzpPcBQuaJU0dhrjhemX29czv6F90C xar4NPbovxS6nLGSRHHcV1K78ZAfxyD8pcuaQcUjDmpwGKVbabYBUouSV1jrwgdP+4T0 ZB927uQaI9o/LBPzualDt0HhAQ2iyuFRSMilaa7NT2jA8h3TS94CyLSQ9oExBrMSgC4W 8YoAP0Y2IXgPgrmDWfku1bIldvlx2t8etF++phndyqUEeZ/txyxqtpdvqM+tYOfoK8fd XN/0C/q3Vw2UMIzZcWYxTBqm3IW/nLRCxGQngsowtzCP4bqend6jhI7uXrLx+zMlcoRY WeAw== 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 p186-v6si15642732pga.2.2018.06.07.10.58.43; Thu, 07 Jun 2018 10:58:57 -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 S934901AbeFGOu3 (ORCPT + 99 others); Thu, 7 Jun 2018 10:50:29 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40840 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935067AbeFGOs1 (ORCPT ); Thu, 7 Jun 2018 10:48:27 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbM-0005hL-7h; Thu, 07 Jun 2018 15:09:20 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvbE-0003Hy-5K; Thu, 07 Jun 2018 15:09:12 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Ralf Baechle" , "John Crispin" , linux-mips@linux-mips.org, "NeilBrown" , "James Hogan" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 386/410] MIPS: ralink: Remove ralink_halt() In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: NeilBrown 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 Cc: John Crispin Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/18851/ Signed-off-by: James Hogan Signed-off-by: Ben Hutchings --- arch/mips/ralink/reset.c | 7 ------- 1 file changed, 7 deletions(-) --- a/arch/mips/ralink/reset.c +++ b/arch/mips/ralink/reset.c @@ -88,16 +88,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; }