Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp604358pxb; Thu, 12 Nov 2020 11:27:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjDKq6IgcmydLsVMha5A4K3dZr6m5MkH/ln+uOvgE/JkJ8K+VbweKLLscPG1UoF/H22I5/ X-Received: by 2002:a17:906:5a97:: with SMTP id l23mr864812ejq.232.1605209279688; Thu, 12 Nov 2020 11:27:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605209279; cv=none; d=google.com; s=arc-20160816; b=PTfa0OWL5X8rFu3OD3k8JuMyDp4Ve4Z9eCfO3ZP1RyYnqRWyCgMTIYVadd2JKAPB7c dW9oaUsG3r2OPz5j73WjMA1/FuCHbhUy967k26wTW53NQAVj14BM85jXbxYMgWM7MDsc 9U/yVdrY5HDgvd28EPBhBALzaGLFvMF3UgO8xD7PgaFJuraDSQiunW44YgINBk7nQvWs oVbtmQjAWuiJYNYTkcsu9Tc+ooCBA07e+0ds0RKTUiAReJblOVE0WwygsiEvifE/oKPu zceAp1COFuothlahll5Ous/DHkFj30aPgwXCQZ4Ry1tI/74VNSLOQpVMuAsdVh+asRz7 Wf8Q== 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=oJKD3BVm8ZEcuKp9dlcgvbuXtdT8Nc2o2oKb6DQKOiw=; b=Nix1XA9h51GFbL+VwvQPCGK5qrAyy+bbb/r5I7L8+UHdRAT1lPbXEdH/jTKYztq/ul vOs3arHx2SWV6wI7XnWwM+6QWPA4TKQ2dEou2hshgt4HyxqyR2aGx01eyGTCTmNDu5CI KpGgb7uxdtPajkJXLH79A9MGMiYRxnssqrglD2enJypgqIz47sMQbgISVk5BabEIkRKk g4KJHzEu5iIL/cb4PSbDFf2bbldqrOBXJib95RXoYmj1Fj0UBCFHGvIQUh7gU3vDSr69 /DSz3kT2//XXUPEKz2v5ExKUg/byTSejrrT+RSY0zZzWJ6h00Tpqs/VF4CMFF6LWzX60 lOQg== 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 n3si4689063edo.468.2020.11.12.11.27.36; Thu, 12 Nov 2020 11:27:59 -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 S1726773AbgKLTZU (ORCPT + 99 others); Thu, 12 Nov 2020 14:25:20 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:65090 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbgKLTZS (ORCPT ); Thu, 12 Nov 2020 14:25:18 -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 e8aaa7f4f64da90c; Thu, 12 Nov 2020 20:25:16 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: Srinivas Pandruvada , Zhang Rui , LKML Subject: [PATCH] cpufreq: intel_pstate: Simplify intel_cpufreq_update_pstate() Date: Thu, 12 Nov 2020 20:25:15 +0100 Message-ID: <1628789.U0t87mjxhl@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 Avoid doing the same assignment in both branches of a conditional, do it after the whole conditional instead. Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/intel_pstate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -2569,14 +2569,13 @@ static int intel_cpufreq_update_pstate(s int old_pstate = cpu->pstate.current_pstate; target_pstate = intel_pstate_prepare_request(cpu, target_pstate); - if (hwp_active) { + if (hwp_active) intel_cpufreq_adjust_hwp(cpu, target_pstate, policy->strict_target, fast_switch); - cpu->pstate.current_pstate = target_pstate; - } else if (target_pstate != old_pstate) { + else if (target_pstate != old_pstate) intel_cpufreq_adjust_perf_ctl(cpu, target_pstate, fast_switch); - cpu->pstate.current_pstate = target_pstate; - } + + cpu->pstate.current_pstate = target_pstate; intel_cpufreq_trace(cpu, fast_switch ? INTEL_PSTATE_TRACE_FAST_SWITCH : INTEL_PSTATE_TRACE_TARGET, old_pstate);