From patchwork Mon Apr 24 17:58:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 98148 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1597645qgf; Mon, 24 Apr 2017 10:59:09 -0700 (PDT) X-Received: by 10.99.119.195 with SMTP id s186mr25900279pgc.179.1493056749581; Mon, 24 Apr 2017 10:59:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si19889837pfb.265.2017.04.24.10.59.09; Mon, 24 Apr 2017 10:59:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-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-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1428338AbdDXR7H (ORCPT + 2 others); Mon, 24 Apr 2017 13:59:07 -0400 Received: from foss.arm.com ([217.140.101.70]:60072 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1428324AbdDXR66 (ORCPT ); Mon, 24 Apr 2017 13:58:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D620015A1; Mon, 24 Apr 2017 10:58:57 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ADAC33F4FF; Mon, 24 Apr 2017 10:58:56 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: sstabellini@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, linux-efi@vger.kernel.org, Julien Grall Subject: [PATCH 2/3 v2] arm/xen: Consolidate calls to shutdown hypercall in a single helper Date: Mon, 24 Apr 2017 18:58:38 +0100 Message-Id: <20170424175839.5262-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170424175839.5262-1-julien.grall@arm.com> References: <20170424175839.5262-1-julien.grall@arm.com> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Signed-off-by: Julien Grall --- Changes in v2: - Patch added --- arch/arm/xen/enlighten.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Stefano Stabellini diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 81e3217b12d3..ba7f4c8f5c3e 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -191,20 +191,24 @@ static int xen_dying_cpu(unsigned int cpu) return 0; } -static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) +void xen_reboot(int reason) { - struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; + struct sched_shutdown r = { .reason = reason }; int rc; + rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); BUG_ON(rc); } +static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) +{ + xen_reboot(SHUTDOWN_reboot); +} + + static void xen_power_off(void) { - struct sched_shutdown r = { .reason = SHUTDOWN_poweroff }; - int rc; - rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); - BUG_ON(rc); + xen_reboot(SHUTDOWN_poweroff); } static irqreturn_t xen_arm_callback(int irq, void *arg)