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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 Dec 2020 19:09:00 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        kernel test robot <lkp@...el.com>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] powercap/drivers/dtpm: Fix __udivdi3 and __aeabi_uldivmod
 unresolved symbols

On Wed, Dec 30, 2020 at 4:38 PM Daniel Lezcano
<daniel.lezcano@...aro.org> wrote:
>
> 32 bits architectures do not support u64 division, so the macro
> DIV_ROUND_CLOSEST is not adequate as the compiler will replace the
> call to an unexisting function for the platform, leading to an
> unresolved symbols.
>
> Fix this by using the compatible macros:
>
> DIV64_U64_ROUND_CLOSEST and DIV_ROUND_CLOSEST_ULL.
>
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.org>

Applied and pushed into the linux-next branch, thanks!

> ---
>  drivers/powercap/dtpm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c
> index 5b6857e9b064..0abcc439d728 100644
> --- a/drivers/powercap/dtpm.c
> +++ b/drivers/powercap/dtpm.c
> @@ -99,8 +99,8 @@ static void __dtpm_rebalance_weight(struct dtpm *dtpm)
>                 pr_debug("Setting weight '%d' for '%s'\n",
>                          child->weight, child->zone.name);
>
> -               child->weight = DIV_ROUND_CLOSEST(child->power_max * 1024,
> -                                                 dtpm->power_max);
> +               child->weight = DIV64_U64_ROUND_CLOSEST(
> +                       child->power_max * 1024, dtpm->power_max);
>
>                 __dtpm_rebalance_weight(child);
>         }
> @@ -272,7 +272,7 @@ static int __set_power_limit_uw(struct dtpm *dtpm, int cid, u64 power_limit)
>                         } else if (power_limit == dtpm->power_min) {
>                                 power = child->power_min;
>                         } else {
> -                               power = DIV_ROUND_CLOSEST(
> +                               power = DIV_ROUND_CLOSEST_ULL(
>                                         power_limit * child->weight, 1024);
>                         }
>
> --
> 2.17.1
>

Powered by blists - more mailing lists