lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hffQ1JBWM_iP25Bta0+tu9cxvi4UmX2RsyqqVNjoPXGA@mail.gmail.com>
Date:   Tue, 30 Jun 2020 20:39:38 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Rafael Wysocki <rjw@...ysocki.net>,
        Linux PM <linux-pm@...r.kernel.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Quentin Perret <qperret@...gle.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] cpufreq: Remove the weakly defined cpufreq_default_governor()

On Mon, Jun 29, 2020 at 10:48 PM Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> The default cpufreq governor is chosen with the help of a "choice"
> option in the Kconfig which will always end up selecting one of the
> governors and so the weakly defined definition of
> cpufreq_default_governor() will never get called.
>
> Moreover, this makes us skip the checking of the return value of that
> routine as it will always be non NULL.
>
> If the Kconfig option changes in future, then we will start getting a
> link error instead (and it won't go unnoticed as in the case of the weak
> definition).
>
> Suggested-by: Quentin Perret <qperret@...gle.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---
> Based over the following series:
> - [PATCH V4 0/3] cpufreq: Allow default governor on cmdline and fix
>   locking issues
>
>  drivers/cpufreq/cpufreq.c | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index ad94b1d47ddb..036f4cc42ede 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1056,11 +1056,6 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)
>         return 0;
>  }
>
> -__weak struct cpufreq_governor *cpufreq_default_governor(void)
> -{
> -       return NULL;
> -}
> -
>  static int cpufreq_init_policy(struct cpufreq_policy *policy)
>  {
>         struct cpufreq_governor *gov = NULL;
> @@ -1079,8 +1074,6 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy)
>
>                 if (!gov) {
>                         gov = cpufreq_default_governor();
> -                       if (!gov)
> -                               return -ENODATA;
>                         __module_get(gov->owner);
>                 }
>
> --

Applied as 5.9 material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ