mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Arnd Bergmann <arnd@arndb.de>, Jiri Pirko <jiri@mellanox.com>,
	Ido Schimmel <idosch@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: Shalom Toledo <shalomt@mellanox.com>,
	Petr Machata <petrm@mellanox.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mlxsw: spectrum_ptp: fix 32-bit build
Date: Thu, 20 Jun 2019 11:53:55 +0300	[thread overview]
Message-ID: <099199e8-bf5a-4124-d850-0bb5a764f17a@cogentembedded.com> (raw)
In-Reply-To: <20190619133128.2259960-1-arnd@arndb.de>

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@arndb.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

      parent reply	other threads:[~2019-06-20  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 13:31 Arnd Bergmann
2019-06-19 13:42 ` Ido Schimmel
2019-06-20  8:53 ` Sergei Shtylyov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=099199e8-bf5a-4124-d850-0bb5a764f17a@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.com \
    --cc=shalomt@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®