From patchwork Wed Jun 19 13:31:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 167240 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp739221ilk; Wed, 19 Jun 2019 06:31:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzsaRwcSCVB4ettV59VHW1IRW1GRP8TG4P8GgJXFCfop6LaNkXe2XLBvSIBVv/gbPnvF9WP X-Received: by 2002:a17:902:5c5:: with SMTP id f63mr119061480plf.176.1560951097981; Wed, 19 Jun 2019 06:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560951097; cv=none; d=google.com; s=arc-20160816; b=Ml2v2v835uSxcyQYuxLrpEJvYLQWgLhI8arrUIkDjGI3i7DAezvjSt6ZKPzgRLGQ4c BjivLcOsVSsmUXDwmZP63b/d9aEzKUZNNw621+xVURbjrDhILq/w82icG6WbUJ6a0HhS ECo+evYM4Q1n+76UdCL3H2qTQKuxeiDOyw+D2qDOpR1bdDFjgmU+AzRdpOh4W8ATMB4z kO42EEbSlAq06qem9wSk2i0mjWGrA2Woa9ur5/PLMl7/9/AfjIrtpQiGYNhdUxM0MH6v 2A/hkerb7Hu2HP+hnm6GJr+O7Br7gD+Kc16M7Who5belTndUnhsu0svTohOFBokGfqqr +vsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KSfYZxaurORuEFyy8sFT8tMAK3mTFk3oefVcdIfxc28=; b=EQj7+MFEKccwQiFqO1NuIz8k9RgAmMA7mUSL2JRMZPepNbVTcTbsCgbMy9JNtd3lfn +3lR2zE9sZQjqtYGbOfk4giDwBoFJzocGJ7kXHHfeYE+NGHcexyElpEXrVrF1izBzp0p VUBtk+hSW2U1et5bZaVI+Rdccp/UOtA0mnGOBxTgWbU7JbqxCwqIFLeC04tCDs8dOBph OsN6NMkk8iH/eNYaz0CnzEGdje/V610fFRULoFv8/B8SUlWXIYHmYFUgoFT4RWOm2asD ZG1HZxXQTxc4t804mnVhRagLdN/N+iv4qeJxZNZR3ci4JC2JDSmavoW0GjHNlrT6xMlo QWvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1si2898317pgs.355.2019.06.19.06.31.37; Wed, 19 Jun 2019 06:31:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730309AbfFSNbg (ORCPT + 30 others); Wed, 19 Jun 2019 09:31:36 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:38789 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725562AbfFSNbf (ORCPT ); Wed, 19 Jun 2019 09:31:35 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1MvKL3-1iUrtQ41zN-00rI0D; Wed, 19 Jun 2019 15:31:30 +0200 From: Arnd Bergmann To: Jiri Pirko , Ido Schimmel , "David S. Miller" Cc: Arnd Bergmann , Shalom Toledo , Petr Machata , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mlxsw: spectrum_ptp: fix 32-bit build Date: Wed, 19 Jun 2019 15:31:20 +0200 Message-Id: <20190619133128.2259960-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:1TWk/Z00tbKqf5RqEcaX5nccgV/fe9V9aNFZmpdUUYBakGdbGvV C+8I324XtE3JT/iwJHKTqKf1+NU7h1FM9RiZJoUaisjO1vKrymmldWMUctjLMLiZLcCGIix YYekoaHxNiKne20tF5Y62n7BA7XD4z5k5uDEobwOxEdN8dPVjfGTQs90R+yRoynQ4/1W6Ev Ygo3OIn9RDZA4vrnpVGUw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:hijGal6cEgc=:RGWiW7YwuVIpQI4lNop8tf R1vbjyIRNCvZb9IH8qwZaAtofbWWx2zA+vrPrTxI9C4+4oEI8Rwrcpkv8jtfM3tAtbjDN/ZoG rwrga+kU4m97DPnxFvVxxXJXNUTgIngENLbgegyonF8Qe6Xj8H5vLSz9Mu8OKY/F63iT1OGGv n8iaA5fGA8yJ3Eb9ZNpYE+4Tz66SbauxsYhrkVrydCY7Xm00UfpJeHoAkKo/9T6irlfkHwEAN /v2hHCn2bjZCWrY6R6K/LKuDu9zQmzZh8mtQcvzOMG0MOr+JYS9iGygAXR7YdalOAPmhePqE6 t2XEfMUYsEQSV6KWQpw6mB/itCX1jrurN9SzA/uGcpxuPtKKqc3SaD2kGllf4ELGiUEO3/Ck3 NNVfq5rV/Co/hAbB8AmDhsqM97ufmDR8IZhUMqymqt21nzher4HYghw+SvnGBfppllbUVL2wd SrlIR8KuKjyIKBmIFHLIgTpnMusbdZqsfShztCjRXQYeJJXXhuaoAGv0RryxX/UYRK+E/JOb5 QtL5feupo7TwWfLmSoaVIc+YtZ1abfFRgOhYIYIe3WUrOIa8vHthCHq324GTo9JWxHOAVmzkQ UwYI0u6D5G44bvKQ+yQkKdh4fjr5R2iiyc8unWCG+4EHXI7FuwgNoiInhCXEZRuq+2EOrobc1 zcKb82PdwCk91FEhFSk5D3sL1pnXTDy+UFNd1E1Tf5YBwwabk39lLJiszyuc5+1Hk4XW0xNZu fWKIg9P+u3Wb2uxHysiODn/4KxZlcDN2rpPqmQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 32-bit architectures, we cannot easily device 64-bit numbers: 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 expensive operation. Fixes: 992aa864dca0 ("mlxsw: spectrum_ptp: Add implementation for physical hardware clock operations") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.0 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);