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: <099199e8-bf5a-4124-d850-0bb5a764f17a@cogentembedded.com>
Date:   Thu, 20 Jun 2019 11:53:55 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     Arnd Bergmann <arnd@...db.de>, Jiri Pirko <jiri@...lanox.com>,
        Ido Schimmel <idosch@...lanox.com>,
        "David S. Miller" <davem@...emloft.net>
Cc:     Shalom Toledo <shalomt@...lanox.com>,
        Petr Machata <petrm@...lanox.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mlxsw: spectrum_ptp: fix 32-bit build

Hello!

On 19.06.2019 16:31, Arnd Bergmann wrote:

> On 32-bit architectures, we cannot easily device 64-bit numbers:

    s/device/divide/?

> ERROR: "__aeabi_uldivmod" [drivers/net/ethernet/mellanox/mlxsw/mlxsw_spectrum.ko] undefined!
> 
> Use do_div() to annotate the fact that we know this is an

    div_u64() really?

> expensive operation.
> 
> Fixes: 992aa864dca0 ("mlxsw: spectrum_ptp: Add implementation for physical hardware clock operations")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>   drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> index 2a9bbc90225e..618e329e1490 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> @@ -87,7 +87,7 @@ mlxsw_sp1_ptp_phc_settime(struct mlxsw_sp_ptp_clock *clock, u64 nsec)
>   	u32 next_sec;
>   	int err;
>   
> -	next_sec = nsec / NSEC_PER_SEC + 1;
> +	next_sec = div_u64(nsec, NSEC_PER_SEC) + 1;
>   	next_sec_in_nsec = next_sec * NSEC_PER_SEC;
>   
>   	spin_lock(&clock->lock);

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ