lkml.org 
[lkml]   [2007]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/6] Suspend: Use common prefix in messages
    Date
    From: Rafael J. Wysocki <rjw@sisk.pl>

    Make suspend messages start with one common prefix "PM: ".

    Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
    ---
    kernel/power/main.c | 19 ++++++++++---------
    kernel/power/power.h | 2 ++
    2 files changed, 12 insertions(+), 9 deletions(-)

    Index: linux-2.6/kernel/power/main.c
    ===================================================================
    --- linux-2.6.orig/kernel/power/main.c
    +++ linux-2.6/kernel/power/main.c
    @@ -183,11 +183,11 @@ static int suspend_prepare(void)

    free_pages = global_page_state(NR_FREE_PAGES);
    if (free_pages < FREE_PAGE_NUMBER) {
    - pr_debug("PM: free some memory\n");
    + pr_debug(PREFIX "Free some memory\n");
    shrink_all_memory(FREE_PAGE_NUMBER - free_pages);
    if (nr_free_pages() < FREE_PAGE_NUMBER) {
    error = -ENOMEM;
    - printk(KERN_ERR "PM: No enough memory\n");
    + printk(KERN_ERR PREFIX "No enough memory\n");
    }
    }
    if (!error)
    @@ -227,7 +227,7 @@ static int suspend_enter(suspend_state_t
    BUG_ON(!irqs_disabled());

    if ((error = device_power_down(PMSG_SUSPEND))) {
    - printk(KERN_ERR "Some devices failed to power down\n");
    + printk(KERN_ERR PREFIX "Some devices failed to power down\n");
    goto Done;
    }

    @@ -261,7 +261,7 @@ int suspend_devices_and_enter(suspend_st
    suspend_console();
    error = device_suspend(PMSG_SUSPEND);
    if (error) {
    - printk(KERN_ERR "Some devices failed to suspend\n");
    + printk(KERN_ERR PREFIX "Some devices failed to suspend\n");
    goto Resume_console;
    }

    @@ -344,11 +344,12 @@ static int enter_state(suspend_state_t s
    if (!mutex_trylock(&pm_mutex))
    return -EBUSY;

    - printk("Syncing filesystems ... ");
    + printk(KERN_INFO PREFIX "Syncing filesystems ... ");
    sys_sync();
    - printk("done.\n");
    + printk(KERN_INFO "done.\n");

    - pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]);
    + pr_debug(PREFIX "Preparing system to enter %s sleep state\n",
    + pm_states[state]);
    error = suspend_prepare();
    if (error)
    goto Unlock;
    @@ -356,11 +357,11 @@ static int enter_state(suspend_state_t s
    if (suspend_test(TEST_FREEZER))
    goto Finish;

    - pr_debug("PM: Entering %s sleep\n", pm_states[state]);
    + pr_debug(PREFIX "Entering %s sleep state\n", pm_states[state]);
    error = suspend_devices_and_enter(state);

    Finish:
    - pr_debug("PM: Finishing wakeup.\n");
    + pr_debug(PREFIX "Finishing wakeup.\n");
    suspend_finish();
    Unlock:
    mutex_unlock(&pm_mutex);
    Index: linux-2.6/kernel/power/power.h
    ===================================================================
    --- linux-2.6.orig/kernel/power/power.h
    +++ linux-2.6/kernel/power/power.h
    @@ -2,6 +2,8 @@
    #include <linux/suspend_ioctls.h>
    #include <linux/utsname.h>

    +#define PREFIX "PM: "
    +
    struct swsusp_info {
    struct new_utsname uts;
    u32 version_code;
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-11-27 00:23    [W:0.026 / U:0.316 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site