Skip to content

Commit

Permalink
cpuidle: governors: Drop redundant checks related to PM QoS
Browse files Browse the repository at this point in the history
PM_QOS_RESUME_LATENCY_NO_CONSTRAINT is defined as the 32-bit integer
maximum, so it is not necessary to test the return value of
dev_pm_qos_raw_read_value() against it directly in the menu and
ladder cpuidle governors.

Drop these redundant checks.

Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
rafaeljw committed May 30, 2018
1 parent b04e217 commit cf7eeea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions drivers/cpuidle/governors/ladder.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ static int ladder_select_state(struct cpuidle_driver *drv,
int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
int resume_latency = dev_pm_qos_raw_read_value(device);

if (resume_latency < latency_req &&
resume_latency != PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
if (resume_latency < latency_req)
latency_req = resume_latency;

/* Special case when user has set very strict latency requirement */
Expand Down
3 changes: 1 addition & 2 deletions drivers/cpuidle/governors/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
data->needs_update = 0;
}

if (resume_latency < latency_req &&
resume_latency != PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
if (resume_latency < latency_req)
latency_req = resume_latency;

/* Special case when user has set very strict latency requirement */
Expand Down

0 comments on commit cf7eeea

Please sign in to comment.