Skip to content

Commit

Permalink
cpuidle: menu: Do not update last_state_idx in menu_select()
Browse files Browse the repository at this point in the history
It is not necessary to update data->last_state_idx in menu_select()
as it only is used in menu_update() which only runs when
data->needs_update is set and that is set only when updating
data->last_state_idx in menu_reflect().

Accordingly, drop the update of data->last_state_idx from
menu_select() and get rid of the (now redundant) "out" label
from it.

No intentional behavior changes.

Signed-off-by: Rafael J. Wysocki <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Daniel Lezcano <[email protected]>
  • Loading branch information
rafaeljw committed Oct 4, 2018
1 parent 96c3d11 commit eb40a38
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/cpuidle/governors/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
s->target_residency <= ktime_to_us(delta_next))
idx = i;

goto out;
return idx;
}
if (s->exit_latency > latency_req) {
/*
Expand Down Expand Up @@ -445,10 +445,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
}
}

out:
data->last_state_idx = idx;

return data->last_state_idx;
return idx;
}

/**
Expand Down

0 comments on commit eb40a38

Please sign in to comment.