Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp30018imm; Fri, 25 May 2018 13:35:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoHZjplR2U+vTsQQ5XC2HgHo4nxoJf0aYP80iEsaPzwiisUxBpwGemuYrhklas3QaRYvFFz X-Received: by 2002:a63:ab05:: with SMTP id p5-v6mr3035320pgf.387.1527280536404; Fri, 25 May 2018 13:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527280536; cv=none; d=google.com; s=arc-20160816; b=clDC1gTpXKDYncCSgCDJ94YFe2n8aNp5jpeq1GMVMXqpDCT/48uiRUWi1C2vPkuWQe asKyqb/JT6VZ2fvM+6fDo0CBtd8r3kJ2Myph/NMeJW0+OojmnHYwkMHQ+oarRSFbTspE kNmLcCqUaRrKXtef1qU9UdNYV6nDSG2hBmaZgDZiL8tggBFH/qvSX07gwOzCeHMjZcdV y9GiYzlhMm5AhoNh/l0EOo3Zdd+rjdvFPCPG6GxjmrC0gyGjVJWrKUu20hFncXZ4QHgp uJZo/LWefZTzH6isr1ZkWR2vB5uQ+BPIGVe6+2ulMwCuhpSUhR0BHrU0gMUfchkgVTax J2Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=6RTfwDykrSPTC5xCruiI935F26BKdd6KVm3chfRA+OU=; b=bJl9rKMfOXUDkNkug2jXQQYI8I2jcryEfoXKPhUB7qWcY8q6jgdXJDBxQP0CcaHLDa OI+NSMJ6sOkzwnQo6uXW2/L9Pfjtextu0VVHu4BSyy6pCgDoMBk/rw1iIHHd9FP2JIAu NwmbJ0edu8KMI9OgShfPVIS2B3WTC0M6FCm1YpAdLIN4mPYa6mxrgDzmo7X8pVEcIGaV w7AFtHyiVZ3EY51vQM38/80QhFePTcT65+kpTkRW1OYR1t/njt0wXHzB0xh+XCeO3EYJ Hu1AGk9qTi1E2BP6k/mIELZ/Lr0Kk+WHjsy7iZM9Adg1WU+SRVy8Y5T58Xch/91GasOm I3NQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14-v6si24063378pfe.29.2018.05.25.13.35.21; Fri, 25 May 2018 13:35:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030441AbeEYUdg (ORCPT + 99 others); Fri, 25 May 2018 16:33:36 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:38032 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968396AbeEYUbT (ORCPT ); Fri, 25 May 2018 16:31:19 -0400 Received: by mail-pf0-f193.google.com with SMTP id o76-v6so3085385pfi.5 for ; Fri, 25 May 2018 13:31:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6RTfwDykrSPTC5xCruiI935F26BKdd6KVm3chfRA+OU=; b=Z3eNnN0ZnV9qp6ltZDCEuY3VuXtga+bGDMkiPmYLcgZgDKNqA1mFTlPkIWQInpxpKI gSdarf8hP4/0LPlZOiEu9faqMLZYkB1KxC+FWV49tG3ZiAw9eQPedeP6ABJgpW1NBhG4 Nhb6GIDXzEDPLocI1Hp5DCLxH3HHWiCZS1pqu0TsHQlU9LU2pnP6tCvn6N1AYAuXNw36 E12AdzQhl79pki/VbCuEVhNz3eYd8UEuBoE22tvpj6Zv8pSebd8LH8BEpDXS9xnoSJCt j04gI0TuC7yUrQvrpnQ4A1waaAtb9uqKzj85GDgE6s6/VL/wHDNIckzDo7xsnlQfYb2R q3IQ== X-Gm-Message-State: ALKqPwfl/KoaBVnjYfx2uSwv78H6nE/t/P8EzvsLtNMvYOPeDm9C5zDl Aa26Ips84QrcTaddXplB+3x0qw== X-Received: by 2002:a62:ab10:: with SMTP id p16-v6mr3946917pff.211.1527280278878; Fri, 25 May 2018 13:31:18 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id p1-v6sm42912360pfp.137.2018.05.25.13.31.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 13:31:18 -0700 (PDT) From: Matthias Kaehlcke To: MyungJoo Ham Cc: Kyungmin Park , Chanwoo Choi , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Douglas Anderson , Matthias Kaehlcke Subject: [PATCH 03/11] PM / devfreq: Remove check for df->max_freq == 0 from governors Date: Fri, 25 May 2018 13:30:35 -0700 Message-Id: <20180525203043.249193-4-mka@chromium.org> X-Mailer: git-send-email 2.17.0.921.gf22659ad46-goog In-Reply-To: <20180525203043.249193-1-mka@chromium.org> References: <20180525203043.249193-1-mka@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit "PM / devfreq: Fix handling of min/max_freq == 0" ensures that df->max_freq is not 0, remove unnecessary checks. Signed-off-by: Matthias Kaehlcke --- drivers/devfreq/governor_performance.c | 5 +---- drivers/devfreq/governor_simpleondemand.c | 7 +++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/devfreq/governor_performance.c b/drivers/devfreq/governor_performance.c index 4d23ecfbd948..1c990cb45098 100644 --- a/drivers/devfreq/governor_performance.c +++ b/drivers/devfreq/governor_performance.c @@ -20,10 +20,7 @@ static int devfreq_performance_func(struct devfreq *df, * target callback should be able to get floor value as * said in devfreq.h */ - if (!df->max_freq) - *freq = UINT_MAX; - else - *freq = df->max_freq; + *freq = df->max_freq; return 0; } diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c index 28e0f2de7100..278964783fa6 100644 --- a/drivers/devfreq/governor_simpleondemand.c +++ b/drivers/devfreq/governor_simpleondemand.c @@ -27,7 +27,6 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD; unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL; struct devfreq_simple_ondemand_data *data = df->data; - unsigned long max = (df->max_freq) ? df->max_freq : UINT_MAX; err = devfreq_update_stats(df); if (err) @@ -47,7 +46,7 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, /* Assume MAX if it is going to be divided by zero */ if (stat->total_time == 0) { - *freq = max; + *freq = df->max_freq; return 0; } @@ -60,13 +59,13 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, /* Set MAX if it's busy enough */ if (stat->busy_time * 100 > stat->total_time * dfso_upthreshold) { - *freq = max; + *freq = df->max_freq; return 0; } /* Set MAX if we do not know the initial frequency */ if (stat->current_frequency == 0) { - *freq = max; + *freq = df->max_freq; return 0; } -- 2.17.0.921.gf22659ad46-goog