[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] pvops dom0 acpi processor cleanup


  • To: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>
  • From: "Yu, Ke" <ke.yu@xxxxxxxxx>
  • Date: Thu, 10 Dec 2009 20:27:07 +0800
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc: Xen-Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 10 Dec 2009 04:27:33 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acp5lBafrGySM6a6SySehz0NVCli7g==
  • Thread-topic: [PATCH] pvops dom0 acpi processor cleanup

acpi processor cleanup

    remove unnecessary macro to reduce the dependency between acpi processor
    driver and xen acpi processor driver, so that make it easy to de-couple
    them in the future.
 
    Signed-off-by: Yu Ke <ke.yu@xxxxxxxxx>

diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index b75098d..df9b8d5 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -1005,9 +1005,8 @@ int acpi_processor_device_add(acpi_handle handle, struct 
acpi_device **device)
        if (!pr)
                return -ENODEV;
 
-       if (processor_cntl_xen())
-               processor_cntl_xen_notify(pr,
-                       PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
+    processor_cntl_xen_notify(pr,
+            PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
 
        if ((pr->id >= 0) && (pr->id < nr_cpu_ids)) {
                kobject_uevent(&(*device)->dev.kobj, KOBJ_ONLINE);
@@ -1048,18 +1047,16 @@ static void __ref 
acpi_processor_hotplug_notify(acpi_handle handle,
                        break;
                }
 
-               if (processor_cntl_xen())
-                       processor_cntl_xen_notify(pr,
-                                       PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
+        processor_cntl_xen_notify(pr,
+                PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
 
                if (pr->id >= 0 && (pr->id < nr_cpu_ids)) {
                        kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
                        break;
                }
 
-               if (processor_cntl_xen())
-                       processor_cntl_xen_notify(pr, PROCESSOR_HOTPLUG,
-                                                       HOTPLUG_TYPE_REMOVE);
+        processor_cntl_xen_notify(pr, PROCESSOR_HOTPLUG,
+                HOTPLUG_TYPE_REMOVE);
 
                result = acpi_processor_start(device);
                if ((!result) && ((pr->id >= 0) && (pr->id < nr_cpu_ids))) {
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 1b382e2..8157ecc 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -458,8 +458,7 @@ static int acpi_processor_get_power_info_cst(struct 
acpi_processor *pr)
                cx.power = obj->integer.value;
 
                /* cache control methods to notify xen*/
-               if (processor_cntl_xen_pm())
-                       processor_cntl_xen_power_cache(pr->acpi_id, i, reg);
+        processor_cntl_xen_power_cache(pr->acpi_id, i, reg);
 
                current_count++;
                memcpy(&(pr->power.states[current_count]), &cx, sizeof(cx));
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 84db5c8..8e3cd82 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -170,9 +170,6 @@ int xen_acpi_processor_ppc_has_changed(struct 
acpi_processor *pr)
 {
        int ret;
 
-       if (!processor_cntl_xen_pmperf())
-               return 0;
-
        ret = acpi_processor_get_platform_limit(pr);
 
        if (ret < 0)
diff --git a/drivers/xen/acpi_processor.c b/drivers/xen/acpi_processor.c
index 7348949..5715c8f 100644
--- a/drivers/xen/acpi_processor.c
+++ b/drivers/xen/acpi_processor.c
@@ -69,30 +69,6 @@ int processor_cntl_xen_power_cache(int cpu, int cx,
 }
 EXPORT_SYMBOL(processor_cntl_xen_power_cache);
 
-int processor_cntl_xen(void)
-{
-       return 1;
-}
-EXPORT_SYMBOL(processor_cntl_xen);
-
-int processor_cntl_xen_pm(void)
-{
-       return (xen_ops.pm_ops[PM_TYPE_IDLE] != NULL);
-}
-EXPORT_SYMBOL(processor_cntl_xen_pm);
-
-int processor_cntl_xen_pmperf(void)
-{
-       return  (xen_ops.pm_ops[PM_TYPE_PERF] != NULL);
-}
-EXPORT_SYMBOL(processor_cntl_xen_pmperf);
-
-int processor_cntl_xen_pmthr(void)
-{
-       return (xen_ops.pm_ops[PM_TYPE_THR] != NULL);
-}
-EXPORT_SYMBOL(processor_cntl_xen_pmthr);
-
 int processor_cntl_xen_notify(struct acpi_processor *pr, int event, int type)
 {
        int ret = -EINVAL;
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 8506688..3e7eab4 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -50,20 +50,12 @@ int (*pm_ops[PM_TYPE_MAX])(struct acpi_processor *pr, int 
event);
        int (*hotplug)(struct acpi_processor *pr, int type);
 };
 
-extern int processor_cntl_xen(void);
-extern int processor_cntl_xen_pm(void);
-extern int processor_cntl_xen_pmperf(void);
-extern int processor_cntl_xen_pmthr(void);
 extern int processor_cntl_xen_notify(struct acpi_processor *pr,
                        int event, int type);
 extern int processor_cntl_xen_power_cache(int cpu, int cx,
                struct acpi_power_register *reg);
 #else
 
-static inline int processor_cntl_xen(void) { return 0; }
-static inline int processor_cntl_xen_pm(void) { return 0; }
-static inline int processor_cntl_xen_pmperf(void) { return 0; }
-static inline int processor_cntl_xen_pmthr(void) { return 0; }
 static inline int processor_cntl_xen_notify(struct acpi_processor *pr,
                        int event, int type)
 {

Attachment: pvop-acpi-processor-cleanup.patch
Description: pvop-acpi-processor-cleanup.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.