• Rafael J. Wysocki's avatar
    cpuidle: menu: Avoid computations when result will be discarded · f1c8e410
    Rafael J. Wysocki authored
    If the minimum interval taken into account in the average computation
    loop in get_typical_interval() is less than the expected idle
    duration determined so far, the resultant average cannot be greater
    than that value as well and the entire return result of the function
    is going to be discarded anyway going forward.
    
    In that case, it is a waste of time to carry out the remaining
    computations in get_typical_interval(), so avoid that by returning
    early if the minimum interval is not below the expected idle duration.
    
    No intentional changes of behavior.
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    f1c8e410
menu.c 18.8 KB