mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
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 <julien.grall@arm.com>
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	[thread overview]
Message-ID: <20170424175839.5262-3-julien.grall@arm.com> (raw)
In-Reply-To: <20170424175839.5262-1-julien.grall@arm.com>

Signed-off-by: Julien Grall <julien.grall@arm.com>

---
    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

  parent reply	other threads:[~2017-04-24 17:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24 17:58 [PATCH 0/3 v2] xen: Implement EFI reset_system callback Julien Grall
2017-04-24 17:58 ` [PATCH 1/3 v2] xen: Export xen_reboot Julien Grall
2017-04-24 18:21   ` Boris Ostrovsky
2017-04-25  4:02     ` Juergen Gross
2017-04-28 17:59       ` Juergen Gross
2017-04-24 17:58 ` Julien Grall [this message]
2017-04-24 19:30   ` [PATCH 2/3 v2] arm/xen: Consolidate calls to shutdown hypercall in a single helper Stefano Stabellini
2017-04-24 17:58 ` [PATCH 3/3 v2] xen: Implement EFI reset_system callback Julien Grall
2017-04-24 18:23   ` Boris Ostrovsky
2017-04-24 19:35   ` Stefano Stabellini
2017-05-02  9:08 ` [PATCH 0/3 " Julien Grall
2017-05-02  9:30   ` Juergen Gross
2017-05-02 10:53     ` Julien Grall
2017-05-02 10:13 ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170424175839.5262-3-julien.grall@arm.com \
    --to=julien.grall@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®