From patchwork Wed May 30 11:41:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 10438753 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5DD04601E9 for ; Wed, 30 May 2018 11:44:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57F0728972 for ; Wed, 30 May 2018 11:44:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C9DB28981; Wed, 30 May 2018 11:44:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B39028982 for ; Wed, 30 May 2018 11:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752511AbeE3LoE (ORCPT ); Wed, 30 May 2018 07:44:04 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:43221 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752034AbeE3LoC (ORCPT ); Wed, 30 May 2018 07:44:02 -0400 Received: from 79.184.254.169.ipv4.supernova.orange.pl (79.184.254.169) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id d7bdd8d4b11febdc; Wed, 30 May 2018 13:44:00 +0200 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Peter Zijlstra , Daniel Lezcano , Ramesh Thomas Subject: [PATCH 1/2] cpuidle: governors: Drop redundant checks related to PM QoS Date: Wed, 30 May 2018 13:41:09 +0200 Message-ID: <2392049.LpkvHV6nCY@aspire.rjw.lan> In-Reply-To: <2261593.SGWtJkXgY3@aspire.rjw.lan> References: <2261593.SGWtJkXgY3@aspire.rjw.lan> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafael J. Wysocki 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 --- drivers/cpuidle/governors/ladder.c | 3 +-- drivers/cpuidle/governors/menu.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) Index: linux-pm/drivers/cpuidle/governors/ladder.c =================================================================== --- linux-pm.orig/drivers/cpuidle/governors/ladder.c +++ linux-pm/drivers/cpuidle/governors/ladder.c @@ -76,8 +76,7 @@ static int ladder_select_state(struct cp 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 */ Index: linux-pm/drivers/cpuidle/governors/menu.c =================================================================== --- linux-pm.orig/drivers/cpuidle/governors/menu.c +++ linux-pm/drivers/cpuidle/governors/menu.c @@ -304,8 +304,7 @@ static int menu_select(struct cpuidle_dr 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 */