Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp605846pxb; Thu, 12 Nov 2020 11:30:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4rIOeSpqCuB96qOh3LNWnDWaa5F8vrkSZNU44VYU2YWfQ27o3mCgvGSShswQJzRur7Y4S X-Received: by 2002:a50:9e8a:: with SMTP id a10mr1569467edf.150.1605209445417; Thu, 12 Nov 2020 11:30:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605209445; cv=none; d=google.com; s=arc-20160816; b=IXRyQyNahmSKS+FV2fzE/nZ7+h0Vn9/Qvep/4dT5+2Ktm8568r07hMtsmFh7slD6CE 905PH0IuyD+rFWKFRjbT/6ZMTBjhpET/6WH1SJDMAWqIr0amGgCRH4mBbrcomrjmkt7i wLmL1jeHX9FmC9xsZr6/YJSK3q3TPZrwq5pIvX8ODcjVpK64/a35Z0ekF1vASVuZPuIH qsn6PoJ+d/FLUtLfaNDjo3rwQMKEaZ0ZajCIHvPBqPHqOVU3UIqkq1l/r0PHfD6vVGAZ sCQaiDxD8QlgYnPUxAU09g8aBbsihnXbl4KVF7ejyrcYAjVgsgYVkvlJnddq9TRyiRvy lZtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=oSZzPo8rKMd6uEqo5Wx+RXfDXFQ0/Vgy9JTPMRpAclA=; b=J2lFeEOxdORUPuHvYySsWOb+fTlL23VvVjfcFu2Zv0CzF15bttFJfqFL6B6QjdgA2b HDqAcrjtWU2BhPtuBPohJP3dyqsJOl7ciWnfa+s2z0PSwBi3PEM4ma3z25mkA4LWO/NR fxUb/aH+ehAXRRgSyGyezWecxc3TUVNsx7OZK2KY/0YrVnyEAN+mcDeXesYsOhdWqRQM 8ExuWGfqaHfwez1CVRNvKvO9aAGp15vO2fCbqQs3CnamtnVQVHc5E1+aadHllkCA8ZGS TqynQ/BiyymgReltiPUpwp7DDnjQWO5+MeH9EeC6WPCXbQ5qYFwdLLnurmRv3ZBcoCpv xJJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k30si4547347edj.161.2020.11.12.11.30.20; Thu, 12 Nov 2020 11:30:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726787AbgKLT0p (ORCPT + 99 others); Thu, 12 Nov 2020 14:26:45 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:53402 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbgKLT0p (ORCPT ); Thu, 12 Nov 2020 14:26:45 -0500 Received: from 89-64-87-233.dynamic.chello.pl (89.64.87.233) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.520) id 1f8f3d0442f51a48; Thu, 12 Nov 2020 20:26:43 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Srinivas Pandruvada , Zhang Rui , Viresh Kumar Subject: [PATCH] cpufreq: schedutil: Simplify sugov_update_next_freq() Date: Thu, 12 Nov 2020 20:26:42 +0100 Message-ID: <25503091.Kiabxektef@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Rearrange a conditional to make it more straightforward. Signed-off-by: Rafael J. Wysocki --- kernel/sched/cpufreq_schedutil.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) Index: linux-pm/kernel/sched/cpufreq_schedutil.c =================================================================== --- linux-pm.orig/kernel/sched/cpufreq_schedutil.c +++ linux-pm/kernel/sched/cpufreq_schedutil.c @@ -102,12 +102,10 @@ static bool sugov_should_update_freq(str static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time, unsigned int next_freq) { - if (!sg_policy->need_freq_update) { - if (sg_policy->next_freq == next_freq) - return false; - } else { + if (sg_policy->need_freq_update) sg_policy->need_freq_update = cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS); - } + else if (sg_policy->next_freq == next_freq) + return false; sg_policy->next_freq = next_freq; sg_policy->last_freq_update_time = time;