lkml.org 
[lkml]   [2012]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/3] PM / Sleep: Make enter_state() in kernel/power/suspend.c static
    On 02/12/2012 04:34 AM, Rafael J. Wysocki wrote:

    > From: Rafael J. Wysocki <rjw@sisk.pl>
    >
    > The enter_state() function in kernel/power/suspend.c should be
    > static and state_store() in kernel/power/suspend.c should call
    > pm_suspend() instead of it, so make that happen (which also reduces
    > code duplication related to suspend statistics).
    >
    > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
    > ---
    > kernel/power/main.c | 6 +-----
    > kernel/power/power.h | 2 --
    > kernel/power/suspend.c | 2 +-
    > 3 files changed, 2 insertions(+), 8 deletions(-)
    >
    > Index: linux/kernel/power/main.c
    > ===================================================================
    > --- linux.orig/kernel/power/main.c
    > +++ linux/kernel/power/main.c
    > @@ -292,11 +292,7 @@ static ssize_t state_store(struct kobjec
    > #ifdef CONFIG_SUSPEND
    > for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) {
    > if (*s && len == strlen(*s) && !strncmp(buf, *s, len))
    > - break;
    > - }
    > - if (state < PM_SUSPEND_MAX && *s) {
    > - error = enter_state(state);
    > - suspend_stats_update(error);
    > + error = pm_suspend(state);


    This code will not stop after calling pm_suspend(). It will try more iterations
    in the for loop right?

    We can probably keep the 'for' loop as it is, and just replace the 'if' block
    following the 'for' loop by: error = pm_suspend(state);

    Regards,
    Srivatsa S. Bhat



    \
     
     \ /
      Last update: 2012-02-12 15:53    [W:0.023 / U:363.172 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site