>From ede9d238638c12dc80e08187500f4ef163e49a49 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong....@intel.com>
Date: Fri, 25 Jan 2013 15:42:31 +0800
Subject: [PATCH 2/3] Move xen_acpi_get_pxm to Xen acpi.h

So that it could be reused by Xen CPU hotplug logic.

Signed-off-by: Liu, Jinsong <jinsong....@intel.com>
---
 drivers/xen/xen-acpi-memhotplug.c |   18 ------------------
 include/xen/acpi.h                |   18 ++++++++++++++++++
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/xen/xen-acpi-memhotplug.c 
b/drivers/xen/xen-acpi-memhotplug.c
index 2c3759a..678680c 100644
--- a/drivers/xen/xen-acpi-memhotplug.c
+++ b/drivers/xen/xen-acpi-memhotplug.c
@@ -65,24 +65,6 @@ static int xen_hotadd_memory(int pxm, struct 
acpi_memory_info *info)
        return rc;
 }
 
-static int xen_acpi_get_pxm(acpi_handle h)
-{
-       unsigned long long pxm;
-       acpi_status status;
-       acpi_handle handle;
-       acpi_handle phandle = h;
-
-       do {
-               handle = phandle;
-               status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
-               if (ACPI_SUCCESS(status))
-                       return pxm;
-               status = acpi_get_parent(handle, &phandle);
-       } while (ACPI_SUCCESS(status));
-
-       return -ENXIO;
-}
-
 static int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 {
        int pxm, result;
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 2b3103b..dc69c91 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -69,4 +69,22 @@ static inline void xen_acpi_sleep_register(void)
 }
 #endif
 
+static inline int xen_acpi_get_pxm(acpi_handle h)
+{
+       unsigned long long pxm;
+       acpi_status status;
+       acpi_handle handle;
+       acpi_handle phandle = h;
+
+       do {
+               handle = phandle;
+               status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
+               if (ACPI_SUCCESS(status))
+                       return pxm;
+               status = acpi_get_parent(handle, &phandle);
+       } while (ACPI_SUCCESS(status));
+
+       return -ENXIO;
+}
+
 #endif /* _XEN_ACPI_H */
-- 
1.7.1

Attachment: 0002-Move-xen_acpi_get_pxm-to-Xen-acpi.h.patch
Description: 0002-Move-xen_acpi_get_pxm-to-Xen-acpi.h.patch

Reply via email to