From patchwork Wed Jul 1 03:26:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: haoxin X-Patchwork-Id: 11635233 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7739E13B6 for ; Wed, 1 Jul 2020 03:26:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6763F2073E for ; Wed, 1 Jul 2020 03:26:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726053AbgGAD0S (ORCPT ); Tue, 30 Jun 2020 23:26:18 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:42785 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbgGAD0R (ORCPT ); Tue, 30 Jun 2020 23:26:17 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01422;MF=xhao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0U1E1Ert_1593573974; Received: from localhost.localdomain(mailfrom:xhao@linux.alibaba.com fp:SMTPD_---0U1E1Ert_1593573974) by smtp.aliyun-inc.com(127.0.0.1); Wed, 01 Jul 2020 11:26:15 +0800 From: Xin Hao To: rjw@rjwysocki.net Cc: viresh.kumar@linaro.org, xhao@linux.alibaba.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] cpufreq: CPPC: fix some unreasonable codes in cppc_cpufreq_perf_to_khz() Date: Wed, 1 Jul 2020 11:26:10 +0800 Message-Id: <20200701032610.11944-1-xhao@linux.alibaba.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The 'caps' variable has been defined, so there is no need to get 'highest_perf' value through 'cpu->caps.highest_perf', you can use 'caps->highest_perf' instead. Signed-off-by: Xin Hao --- drivers/cpufreq/cppc_cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.24.1 diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 257d726a4456..444ee76a6bae 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -161,7 +161,7 @@ static unsigned int cppc_cpufreq_perf_to_khz(struct cppc_cpudata *cpu, if (!max_khz) max_khz = cppc_get_dmi_max_khz(); mul = max_khz; - div = cpu->perf_caps.highest_perf; + div = caps->highest_perf; } return (u64)perf * mul / div; }