linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dpaa2-eth: debugfs: use div64_u64 for division
@ 2020-04-29  8:47 Arnd Bergmann
  2020-04-29  9:18 ` Ioana Ciornei
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-04-29  8:47 UTC (permalink / raw)
  To: Ioana Ciornei, Ioana Radulescu, David S. Miller
  Cc: Arnd Bergmann, Greg Kroah-Hartman, netdev, linux-kernel

A plain 64-bit division breaks building on 32-bit architectures:

ERROR: modpost: "__aeabi_uldivmod" [drivers/net/ethernet/freescale/dpaa2/fsl-dpaa2-eth.ko] undefined!

As this function is not performance critical, just use the external
helper instead.

Fixes: 460fd830dd9d ("dpaa2-eth: add channel stat to debugfs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
index 80291afff3ea..0a31e4268dfb 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
@@ -139,7 +139,7 @@ static int dpaa2_dbg_ch_show(struct seq_file *file, void *offset)
 			   ch->stats.dequeue_portal_busy,
 			   ch->stats.frames,
 			   ch->stats.cdan,
-			   ch->stats.frames / ch->stats.cdan,
+			   div64_u64(ch->stats.frames, ch->stats.cdan),
 			   ch->buf_count);
 	}
 
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] dpaa2-eth: debugfs: use div64_u64 for division
  2020-04-29  8:47 [PATCH] dpaa2-eth: debugfs: use div64_u64 for division Arnd Bergmann
@ 2020-04-29  9:18 ` Ioana Ciornei
  0 siblings, 0 replies; 2+ messages in thread
From: Ioana Ciornei @ 2020-04-29  9:18 UTC (permalink / raw)
  To: Arnd Bergmann, Ioana Ciocoi Radulescu, David S. Miller
  Cc: Greg Kroah-Hartman, netdev, linux-kernel

> Subject: [PATCH] dpaa2-eth: debugfs: use div64_u64 for division
> 
> A plain 64-bit division breaks building on 32-bit architectures:
> 
> ERROR: modpost: "__aeabi_uldivmod"
> [drivers/net/ethernet/freescale/dpaa2/fsl-dpaa2-eth.ko] undefined!
> 
> As this function is not performance critical, just use the external helper instead.
> 
> Fixes: 460fd830dd9d ("dpaa2-eth: add channel stat to debugfs")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for the patch.
A fix for this was applied some hours ago on the net-next branch.

--
Ioana

> ---
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
> b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
> index 80291afff3ea..0a31e4268dfb 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
> @@ -139,7 +139,7 @@ static int dpaa2_dbg_ch_show(struct seq_file *file, void
> *offset)
>  			   ch->stats.dequeue_portal_busy,
>  			   ch->stats.frames,
>  			   ch->stats.cdan,
> -			   ch->stats.frames / ch->stats.cdan,
> +			   div64_u64(ch->stats.frames, ch->stats.cdan),
>  			   ch->buf_count);
>  	}
> 
> --
> 2.26.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-29  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29  8:47 [PATCH] dpaa2-eth: debugfs: use div64_u64 for division Arnd Bergmann
2020-04-29  9:18 ` Ioana Ciornei

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).