• Stephen Rothwell's avatar
    [PATCH] APM patch: apm_cpu_idle cleanups · 10caf7bf
    Stephen Rothwell authored
    Number 7.
    
    This patch contains four cleanup changes whose aim
    is better code self-documentation (the best way to
    document IMHO).  They are sent together because they
    overlap.
    
    1. Rename the variable "sys_idle" to 'original_pm_idle'.
    This is where we store the value that we find in pm_idle before
    we substitute the address of our own apm_cpu_idle() function.
    In principle we have no idea whose address this is, so
    the variable name shouldn't imply that we know that this is
    the address of a system idle function; it should simply
    indicate that it is the original value of pm_idle.
    
    2. Variable "apm_is_idle" is renamed 'apm_idle_done'.
    This flag indicates when apm_do_idle() has been called.
    It is a premise of apm_cpu_idle()'s operation that it is
    not known whether the apm_do_idle() function really idles
    the CPU.  The name of the flag should not lead one to
    believe otherwise.
    
    3. Variable "t1" is renamed 'bucket'.  The variable is not
    a time but a countdown ("bucket"), so the variable name
    should not lead one to believe it is some sort of time
    value.
    
    4. A default: case is added to the switch in order to
    remind the reader that there is a third possible return
    value from apm_do_idle().
    10caf7bf
apm.c 56.5 KB