From patchwork Fri Jul 18 15:37:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dirk.brandewie@gmail.com X-Patchwork-Id: 4586301 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 78B489F26C for ; Fri, 18 Jul 2014 15:38:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C65D82018E for ; Fri, 18 Jul 2014 15:37:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F99D20160 for ; Fri, 18 Jul 2014 15:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422799AbaGRPhs (ORCPT ); Fri, 18 Jul 2014 11:37:48 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:44483 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422773AbaGRPhr (ORCPT ); Fri, 18 Jul 2014 11:37:47 -0400 Received: by mail-pa0-f50.google.com with SMTP id et14so5644338pad.37 for ; Fri, 18 Jul 2014 08:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KzMMQR6sM514JGwIsmhoJrBFKU2o5I4e1T8qdfV36mM=; b=v9CdrMscVDludrJCGJAquF0ucNpca+MGvE477WV88jH+BkJWrVHdugmrtIrAWm+cks V89d/fl1GuNqpaPQGhsBmIMv1Z2Tu4p6Zxp11zy3WHA18NgsPTDPwRnEiVmysWqCzzyg 6baR1H9Su64Zs0XSdTHrVkmfz1E+9aR2H/WEwdxXfYucbvzAiAVazb/pKL22TaijQCcW KX6+bHT/opQIhmvYSLM/Al6ZlxYAZli0nQec6FIi+KVM/FpZrk1egeP30M1T9sFy6ujL jeb4pQ10QtRwsoihybkFYajmFEGXDJo1DtLNYq9B45Q4s9DhCfvacj7OPsVqYNcyd9Nr XuHA== X-Received: by 10.66.139.233 with SMTP id rb9mr6106656pab.5.1405697866748; Fri, 18 Jul 2014 08:37:46 -0700 (PDT) Received: from echolake.localdomain (static-50-43-41-81.bvtn.or.frontiernet.net. [50.43.41.81]) by mx.google.com with ESMTPSA id be7sm7894439pdb.37.2014.07.18.08.37.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jul 2014 08:37:45 -0700 (PDT) From: dirk.brandewie@gmail.com X-Google-Original-From: dirk.j.brandewie@intel.com To: linux-pm@vger.kernel.org Cc: rjw@rjwysocki.net, Stratos Karafotis , Dirk Brandewie Subject: [PATCH 05/11] cpufreq: intel_pstate: Cleanup parentheses Date: Fri, 18 Jul 2014 08:37:21 -0700 Message-Id: <1405697848-13546-6-git-send-email-dirk.j.brandewie@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1405697848-13546-1-git-send-email-dirk.j.brandewie@intel.com> References: <1405697848-13546-1-git-send-email-dirk.j.brandewie@intel.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Stratos Karafotis Remove unnecessary parentheses. Also, add parentheses in one case for better readability. Signed-off-by: Stratos Karafotis Signed-off-by: Dirk Brandewie --- drivers/cpufreq/intel_pstate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 424c5a9..dee9e58 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -443,7 +443,7 @@ static int core_get_turbo_pstate(void) rdmsrl(MSR_NHM_TURBO_RATIO_LIMIT, value); nont = core_get_max_pstate(); - ret = ((value) & 255); + ret = (value) & 255; if (ret <= nont) ret = nont; return ret; @@ -617,7 +617,7 @@ static inline int32_t intel_pstate_get_scaled_busy(struct cpudata *cpu) current_pstate = int_tofp(cpu->pstate.current_pstate); core_busy = mul_fp(core_busy, div_fp(max_pstate, current_pstate)); - sample_time = (pid_params.sample_rate_ms * USEC_PER_MSEC); + sample_time = pid_params.sample_rate_ms * USEC_PER_MSEC; duration_us = (u32) ktime_us_delta(cpu->sample.time, cpu->last_sample_time); if (duration_us > sample_time * 3) { @@ -751,7 +751,7 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) limits.min_perf_pct = clamp_t(int, limits.min_perf_pct, 0 , 100); limits.min_perf = div_fp(int_tofp(limits.min_perf_pct), int_tofp(100)); - limits.max_policy_pct = policy->max * 100 / policy->cpuinfo.max_freq; + limits.max_policy_pct = (policy->max * 100) / policy->cpuinfo.max_freq; limits.max_policy_pct = clamp_t(int, limits.max_policy_pct, 0 , 100); limits.max_perf_pct = min(limits.max_policy_pct, limits.max_sysfs_pct); limits.max_perf = div_fp(int_tofp(limits.max_perf_pct), int_tofp(100)); @@ -763,8 +763,8 @@ static int intel_pstate_verify_policy(struct cpufreq_policy *policy) { cpufreq_verify_within_cpu_limits(policy); - if ((policy->policy != CPUFREQ_POLICY_POWERSAVE) && - (policy->policy != CPUFREQ_POLICY_PERFORMANCE)) + if (policy->policy != CPUFREQ_POLICY_POWERSAVE && + policy->policy != CPUFREQ_POLICY_PERFORMANCE) return -EINVAL; return 0;