From patchwork Mon Feb 26 05:08:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10241245 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5727360208 for ; Mon, 26 Feb 2018 05:09:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49920292DF for ; Mon, 26 Feb 2018 05:09:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E485297C3; Mon, 26 Feb 2018 05:09:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAA54292DF for ; Mon, 26 Feb 2018 05:09:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751796AbeBZFJv (ORCPT ); Mon, 26 Feb 2018 00:09:51 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:35059 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbeBZFJu (ORCPT ); Mon, 26 Feb 2018 00:09:50 -0500 Received: by mail-pl0-f68.google.com with SMTP id bb3so8659840plb.2 for ; Sun, 25 Feb 2018 21:09:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=QB3U3wNTRzX+nNCSEUoo+x9xxg5FbU24KRQPrR0oTGQ=; b=eNjFPzdfIkQ5aQuJ78O1GgEvsThfgpFd9YlW21Dco+pjVj+VIa9PukKLQ3YmdmsAdo bbh+N5CHHOGwYyvFCCmToDccZ7ZF9ieVXnhamOOlvFspa5x+udmzK8bxgbM9j+4dfDm6 vpT4/nlzPExYenkBESi07LaW2ZJzuizXZAlfY= 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:in-reply-to:references; bh=QB3U3wNTRzX+nNCSEUoo+x9xxg5FbU24KRQPrR0oTGQ=; b=UMCpqmeodJdoFtUj7YyUKmrLghcaHN80t5NCOhOV7Mm44V16J6xExkG3KLqw9nzx38 cPP2CsFBtY1jyxTCZQp9pIfo9Vj6ymURXMftkQP6MKPhOWBinlfMCdfmcwWnMf+jXtxc Mf3DpgY8QR5/IGP0xomqwzBHu2m8GZWpOOwGag8eOW59uSRcQblR/zn15wSiAGVcbIsY 2ygyQIf/AB072E+/e9S70cfzR8HuWuQf/h5Qt+GUJeObAZoYLaXjKESAGAKzk0o0/h7K d/lQGF0pu1ORjYBHu5apgGDLJkheRbSBgSA6pW7VyDl1KbuNgc7yCgLw56Gghq0mgj56 qMUA== X-Gm-Message-State: APf1xPBNQgyeu4i8Sb+NtB8u5przpWQu/1aTCLnM4quLnxE7XF4OALb6 AroBxYr/TD6npRSczUd28dMfvGIUZZ4= X-Google-Smtp-Source: AH8x224I/ohwnICMxoSdgRUgABCgzSvTlkBTQ1oY4PTja/sUROqoPBzmv38l+WrVaWB/AsG4fXgVNw== X-Received: by 2002:a17:902:7844:: with SMTP id e4-v6mr9130786pln.83.1519621790273; Sun, 25 Feb 2018 21:09:50 -0800 (PST) Received: from localhost ([122.172.92.38]) by smtp.gmail.com with ESMTPSA id a87sm16221323pfj.13.2018.02.25.21.09.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Feb 2018 21:09:49 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot Subject: [PATCH 08/27] cpufreq: e_powersaver: Don't validate the frequency table twice Date: Mon, 26 Feb 2018 10:38:51 +0530 Message-Id: <8c69a1611f395d02f2bf53cca5fba7f1007059cc.1519620578.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The cpufreq core is already validating the CPU frequency table after calling the ->init() callback of the cpufreq drivers and the drivers don't need to do the same anymore. Though they need to set the policy->freq_table field directly from the ->init() callback now. Stop validating the frequency table from e_powersaver driver. Signed-off-by: Viresh Kumar --- drivers/cpufreq/e_powersaver.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c index cdf097b29862..60bea302abbe 100644 --- a/drivers/cpufreq/e_powersaver.c +++ b/drivers/cpufreq/e_powersaver.c @@ -184,7 +184,6 @@ static int eps_cpu_init(struct cpufreq_policy *policy) struct cpuinfo_x86 *c = &cpu_data(0); struct cpufreq_frequency_table *f_table; int k, step, voltage; - int ret; int states; #if IS_ENABLED(CONFIG_ACPI_PROCESSOR) unsigned int limit; @@ -359,12 +358,7 @@ static int eps_cpu_init(struct cpufreq_policy *policy) } policy->cpuinfo.transition_latency = 140000; /* 844mV -> 700mV in ns */ - - ret = cpufreq_table_validate_and_show(policy, ¢aur->freq_table[0]); - if (ret) { - kfree(centaur); - return ret; - } + policy->freq_table = ¢aur->freq_table[0]; return 0; }