From: Eric Dumazet <eric.dumazet@gmail.com>
To: Randy Dunlap <rdunlap@infradead.org>, David Miller <davem@davemloft.net>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Amir Vadai <amirv@mellanox.com>
Subject: [PATCH net-next] mlx4_en: fix a build error on 32bit arches
Date: Tue, 30 Apr 2013 13:53:51 -0700 [thread overview]
Message-ID: <1367355231.11020.10.camel@edumazet-glaptop> (raw)
In-Reply-To: <51802BE9.7020805@infradead.org>
From: Eric Dumazet <edumazet@google.com>
commit b6c39bfcf1d7d63 ("net/mlx4_en: Add a service task")
added a build error on 32bit arches.
ERROR: "__udivdi3" [drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko]
undefined!
Fix this problem by using do_div()
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/en_clock.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index 2f18121..fd64410 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -114,6 +114,7 @@ void mlx4_en_fill_hwtstamps(struct mlx4_en_dev *mdev,
void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
{
struct mlx4_dev *dev = mdev->dev;
+ u64 ns;
memset(&mdev->cycles, 0, sizeof(mdev->cycles));
mdev->cycles.read = mlx4_en_read_clock;
@@ -133,10 +134,9 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
/* Calculate period in seconds to call the overflow watchdog - to make
* sure counter is checked at least once every wrap around.
*/
- mdev->overflow_period =
- (cyclecounter_cyc2ns(&mdev->cycles,
- mdev->cycles.mask) / NSEC_PER_SEC / 2)
- * HZ;
+ ns = cyclecounter_cyc2ns(&mdev->cycles, mdev->cycles.mask);
+ do_div(ns, NSEC_PER_SEC / 2 / HZ);
+ mdev->overflow_period = ns;
}
void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev)
next prev parent reply other threads:[~2013-04-30 20:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 6:57 linux-next: Tree for Apr 30 Stephen Rothwell
2013-04-30 18:42 ` linux-next: Tree for Apr 30 (sound) Randy Dunlap
2013-04-30 18:58 ` linux-next: Tree for Apr 30 (netdev: mellanox/mlx4) Randy Dunlap
2013-04-30 19:36 ` Eric Dumazet
2013-04-30 20:39 ` Randy Dunlap
2013-04-30 20:47 ` Eric Dumazet
2013-04-30 20:53 ` Eric Dumazet [this message]
2013-04-30 23:01 ` [PATCH net-next] mlx4_en: fix a build error on 32bit arches David Miller
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=1367355231.11020.10.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=amirv@mellanox.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=sfr@canb.auug.org.au \
/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;
as well as URLs for NNTP newsgroup(s).