Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3586773pxb; Mon, 16 Nov 2020 20:20:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuQsDJ75t+CAl1x/82LnYzL89zSUrUx9VnLXMfAON6LGsvToZK6EU96OK60QqT8XwZijPU X-Received: by 2002:a05:6402:1115:: with SMTP id u21mr18629815edv.148.1605586851173; Mon, 16 Nov 2020 20:20:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605586851; cv=none; d=google.com; s=arc-20160816; b=0/SsQsCrl/bVYTvtV5Xm3hYTitK0JkbzCnecOAFCXfHqLqcT0pKvmK01MLD4UdMkzh iMnk/+X+ve7BGd4ZdF6TngypUls4Kd5ZTNx1EGxYio7XItUZd43RSyXZYm0YrWsqkKeS cMZlwooz2Uffa/gbsiY3xxKz6rDgeix0jvnay/d7SNRaGagWYToYN2/SlglRAOraG1+k G+nHQlyP1FF22xl6llPLX/qB0yoXRn48ILT4YdWhiA++U19EEwhmKKZNIprumbyVVnG+ 2huI9wDz6XZKjlXYg/f17BParRqlwIUAwc6WzgksVLna5yixmjn+VoVO0LJgiboT0Z7x jTlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5lv6RfP8qJF5zkeuOHJR2hccKAcSS2SlN9owQue64IU=; b=mlWCAGfg9AiTwq9+hphE98VOqznmC4i4+ct0YkEq96xcB1yn8Dqy5yvDP6K1irybze ctsQLLUDXPSVBdpFJQ0F0dEuLYwZz4gBC9a7TnklyiBhEy7vEblhmMIUJjRgjKEzOHk6 7EjnNUcc6QYqaCYeAK/KIIFaeFCH/PbxwDaa5xblHupOndZ7fGOgFRgAO3rZunPQcbXn qs8N33+uDTSohvqmYhF9css2Ir5Ug2s7U4LLLi3pYRcW672XxCo+1KtC0M3nNkq0Fla1 saoIL2bEJecohxCqSwBFjcThfojFJjXg2azRWgOjmkTkuqYcMi8polon4HUcpOpLWYhX 889A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CsMzAUSR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si12116550ejl.139.2020.11.16.20.20.28; Mon, 16 Nov 2020 20:20:51 -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; dkim=pass header.i=@linaro.org header.s=google header.b=CsMzAUSR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727098AbgKQEP7 (ORCPT + 99 others); Mon, 16 Nov 2020 23:15:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726827AbgKQEP7 (ORCPT ); Mon, 16 Nov 2020 23:15:59 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43C95C0613CF for ; Mon, 16 Nov 2020 20:15:59 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id 62so15171190pgg.12 for ; Mon, 16 Nov 2020 20:15:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5lv6RfP8qJF5zkeuOHJR2hccKAcSS2SlN9owQue64IU=; b=CsMzAUSREoHBdOFlF17Kh8CLBA0AOwM7j9djxKPsNMLczyCCKIrDjqJypaW6xrc73j BcQyU9ga/xqoTAQHq8b22DznzWXVX+olP97SKTMInqsim2q5A2Sc4qpEeTJcbZNCJlqN gxlO8zY3VjlZOwbn4WVZt8QswZ0lbWsqCevhyd1RagEUzh+sbZs7uzqcSS4rsKp7/Bqn QrJa0jxAY9duJ+c3wZqwNFs6xo8vpBfamCdHtDwrShSsHbJBIUO7BuclicfWqBzFFtQV iH0WsmGLyMTQQl2sEkC0XVH1JlcacAi7bTR7E4oVbYKTunOoTQmfGG1MEn04IIagMeqQ Mmfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5lv6RfP8qJF5zkeuOHJR2hccKAcSS2SlN9owQue64IU=; b=cgM3stcUijFqJFBxlGJIm1sBFuErgle82KXN/U1kI6kw1/0FmZjU1j6aMy8OjRs8JI G1Pig5SZrfDtCSOSY+RIuvHGGSN+XBdNajmOtIfFKY66TvFGvDPHkvBQQYNzFw3dIgYS gqlgiiFQ6SyiHZ6BOIwzg0P/ypX+AEH0H4k4ghuNQb7BQRG5OiYxeNllb9YSP5fj19Qy U5VHvXfEDUp7pm0L8z6Zi/EPcpzpW+9ynx0UJZcwjUFuw3N9CUx0RI23K6gUDvZNO+R3 WjUaAkc0HiHLzG85C4rEAsYd9Lk+LsBwH0115NfHNd8bmNkCPqsKuHawi/AW2YbdR4Y2 apOA== X-Gm-Message-State: AOAM53010nggmYf8AQWm7tMVdJGwI0pY8zt0bQo/i60m6JSNhYprwCAJ dDMtG+MWuf2Fg4RWRqpnXCFFFg== X-Received: by 2002:a62:5e06:0:b029:164:a9ca:b07e with SMTP id s6-20020a625e060000b0290164a9cab07emr16459338pfb.36.1605586558858; Mon, 16 Nov 2020 20:15:58 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id 131sm3889341pfw.117.2020.11.16.20.15.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2020 20:15:58 -0800 (PST) Date: Tue, 17 Nov 2020 09:45:55 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM , LKML , Srinivas Pandruvada , Zhang Rui Subject: Re: [PATCH] cpufreq: schedutil: Simplify sugov_update_next_freq() Message-ID: <20201117041555.s6x7wpjpnhfq7y3m@vireshk-i7> References: <25503091.Kiabxektef@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25503091.Kiabxektef@kreacher> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12-11-20, 20:26, Rafael J. Wysocki wrote: > 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; > Acked-by: Viresh Kumar -- viresh