]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Trivial APM update part 1
authorStephen Rothwell <sfr@canb.auug.org.au>
Tue, 12 Mar 2002 04:56:11 +0000 (20:56 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 12 Mar 2002 04:56:11 +0000 (20:56 -0800)
This is the first of a series of patches I have got from Thomas Hood
that modify the apm code mainly for better self documentation.

This one does:

Variable "waiting_for_resume" is renamed 'ignore_sys_suspend'.
The reason for the change is that this flag variable is
employed in a manner analogous to that of other flag variables
named 'ignore ...'.  When the flag is set, the driver needs to
ignore further system suspends.  The driver does not "wait"
in the usual sense of that word.  The only sense in which the
driver waits is the sense in which it needs to continue to
ignore system suspends until certain events occur.  One such
event is a resume.  However, another such event is the vetoing
of the suspend request by a driver.  So it would be more
accurate to call the flag 'waiting_for_resume_or_suspend_reject'
or something like that.  But for the reason mentioned first,
an even better name is 'ignore_sys_suspend'.

arch/i386/kernel/apm.c

index 3a397576b41ae232235f6c679792cc840dc27a6f..2ae88bae9ea0960fe101d1c0ac755f13a32c2f6d 100644 (file)
@@ -380,7 +380,7 @@ static int                  idle_period = DEFAULT_IDLE_PERIOD;
 static int                     set_pm_idle;
 static int                     suspends_pending;
 static int                     standbys_pending;
-static int                     waiting_for_resume;
+static int                     ignore_sys_suspend;
 static int                     ignore_normal_resume;
 static int                     bounce_interval = DEFAULT_BOUNCE_INTERVAL;
 
@@ -1200,7 +1200,7 @@ static int suspend(int vetoable)
                        if (apm_info.connection_version > 0x100)
                                apm_set_power_state(APM_STATE_REJECT);
                        err = -EBUSY;
-                       waiting_for_resume = 0;
+                       ignore_sys_suspend = 0;
                        printk(KERN_WARNING "apm: suspend was vetoed.\n");
                        goto out;
                }
@@ -1308,9 +1308,9 @@ static void check_events(void)
                         * sending a SUSPEND event until something else
                         * happens!
                         */
-                       if (waiting_for_resume)
+                       if (ignore_sys_suspend)
                                return;
-                       waiting_for_resume = 1;
+                       ignore_sys_suspend = 1;
                        queue_event(event, NULL);
                        if (suspends_pending <= 0)
                                (void) suspend(1);
@@ -1319,7 +1319,7 @@ static void check_events(void)
                case APM_NORMAL_RESUME:
                case APM_CRITICAL_RESUME:
                case APM_STANDBY_RESUME:
-                       waiting_for_resume = 0;
+                       ignore_sys_suspend = 0;
                        last_resume = jiffies;
                        ignore_bounce = 1;
                        if ((event != APM_NORMAL_RESUME)