Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S976406AbdDXTbA (ORCPT ); Mon, 24 Apr 2017 15:31:00 -0400 Received: from mail.kernel.org ([198.145.29.136]:45448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763664AbdDXTay (ORCPT ); Mon, 24 Apr 2017 15:30:54 -0400 Date: Mon, 24 Apr 2017 12:30:50 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: Julien Grall cc: xen-devel@lists.xen.org, sstabellini@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, linux-efi@vger.kernel.org Subject: Re: [PATCH 2/3 v2] arm/xen: Consolidate calls to shutdown hypercall in a single helper In-Reply-To: <20170424175839.5262-3-julien.grall@arm.com> Message-ID: References: <20170424175839.5262-1-julien.grall@arm.com> <20170424175839.5262-3-julien.grall@arm.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1326 Lines: 51 On Mon, 24 Apr 2017, Julien Grall wrote: > Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini > --- > Changes in v2: > - Patch added > --- > arch/arm/xen/enlighten.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > 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) > -- > 2.11.0 >