ia64/xen-unstable

changeset 15634:091134f5555c

Xen PM: Clean up printk usage.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Jul 20 10:47:11 2007 +0100 (2007-07-20)
parents 8e2d43396306
children 3c28bc13a3f8
files xen/arch/x86/acpi/power.c
line diff
     1.1 --- a/xen/arch/x86/acpi/power.c	Fri Jul 20 10:41:31 2007 +0100
     1.2 +++ b/xen/arch/x86/acpi/power.c	Fri Jul 20 10:47:11 2007 +0100
     1.3 @@ -26,7 +26,7 @@
     1.4  #include <xen/console.h>
     1.5  #include <public/platform.h>
     1.6  
     1.7 -#define pmprintk(_l, _f, _a...) printk(_l "<PM>" _f, ## _a )
     1.8 +#define pmprintk(_l, _f, _a...) printk(_l "<PM> " _f "\n", ## _a )
     1.9  
    1.10  static char opt_acpi_sleep[20];
    1.11  string_param("acpi_sleep", opt_acpi_sleep);
    1.12 @@ -38,13 +38,6 @@ struct acpi_sleep_info acpi_sinfo;
    1.13  
    1.14  void do_suspend_lowlevel(void);
    1.15  
    1.16 -static char *acpi_states[ACPI_S_STATE_COUNT] =
    1.17 -{
    1.18 -    [ACPI_STATE_S1] = "standby",
    1.19 -    [ACPI_STATE_S3] = "mem",
    1.20 -    [ACPI_STATE_S4] = "disk",
    1.21 -};
    1.22 -
    1.23  static int device_power_down(void)
    1.24  {
    1.25      console_suspend();
    1.26 @@ -122,8 +115,7 @@ static int enter_state(u32 state)
    1.27      if ( !spin_trylock(&pm_lock) )
    1.28          return -EBUSY;
    1.29  
    1.30 -    pmprintk(XENLOG_INFO, "PM: Preparing system for %s sleep\n",
    1.31 -        acpi_states[state]);
    1.32 +    pmprintk(XENLOG_INFO, "Preparing system for ACPI S%d state.", state);
    1.33  
    1.34      freeze_domains();
    1.35  
    1.36 @@ -131,7 +123,7 @@ static int enter_state(u32 state)
    1.37      if ( num_online_cpus() != 1 )
    1.38      {
    1.39          error = -EBUSY;
    1.40 -        goto Enable_cpu;
    1.41 +        goto enable_cpu;
    1.42      }
    1.43  
    1.44      hvm_cpu_down();
    1.45 @@ -142,8 +134,8 @@ static int enter_state(u32 state)
    1.46  
    1.47      if ( (error = device_power_down()) )
    1.48      {
    1.49 -        printk(XENLOG_ERR "Some devices failed to power down\n");
    1.50 -        goto Done;
    1.51 +        pmprintk(XENLOG_ERR, "Some devices failed to power down.");
    1.52 +        goto done;
    1.53      }
    1.54  
    1.55      ACPI_FLUSH_CPU_CACHE();
    1.56 @@ -161,23 +153,20 @@ static int enter_state(u32 state)
    1.57          break;
    1.58      }
    1.59  
    1.60 -    pmprintk(XENLOG_INFO, "Back to C!\n");
    1.61 +    pmprintk(XENLOG_DEBUG, "Back to C.");
    1.62  
    1.63      device_power_up();
    1.64  
    1.65 -    pmprintk(XENLOG_INFO, "PM: Finishing wakeup.\n");
    1.66 +    pmprintk(XENLOG_INFO, "Finishing wakeup from ACPI S%d state.", state);
    1.67  
    1.68 - Done:
    1.69 + done:
    1.70      local_irq_restore(flags);
    1.71 -
    1.72      acpi_sleep_post(state);
    1.73 -
    1.74      if ( !hvm_cpu_up() )
    1.75          BUG();
    1.76  
    1.77 - Enable_cpu:
    1.78 + enable_cpu:
    1.79      enable_nonboot_cpus();
    1.80 -
    1.81      thaw_domains();
    1.82      spin_unlock(&pm_lock);
    1.83      return error;
    1.84 @@ -208,7 +197,7 @@ int acpi_enter_sleep(struct xenpf_enter_
    1.85           ((sleep->pm1a_cnt_val ^ sleep->pm1b_cnt_val) &
    1.86            ACPI_BITMASK_SLEEP_ENABLE) )
    1.87      {
    1.88 -        pmprintk(XENLOG_ERR, "Mismatched pm1a/pm1b setting\n");
    1.89 +        pmprintk(XENLOG_ERR, "Mismatched pm1a/pm1b setting.");
    1.90          return -EINVAL;
    1.91      }
    1.92  
    1.93 @@ -275,7 +264,7 @@ static int __init acpi_sleep_init(void)
    1.94              p += strspn(p, ", \t");
    1.95      }
    1.96  
    1.97 -    pmprintk(XENLOG_INFO, "ACPI (supports");
    1.98 +    printk(XENLOG_INFO "<PM> ACPI (supports");
    1.99      for ( i = 0; i < ACPI_S_STATE_COUNT; i++ )
   1.100      {
   1.101          if ( i == ACPI_STATE_S3 )