Skip to contentSkip to conversation

dpaa2-eth: debugfs: use div64_u64 for division

PATCH In review Arnd Bergmann 2 participants 2 messages Apr 29, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c +1 -1
index 80291afff3ea..0a31e4268dfb 100644
@@ -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);
 	}
 
Signature · 1 line
2.26.0
maintainer
#1 lore raw
Quoted 11 lines

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

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

--
Ioana

Quoted 21 lines
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c +1 -2
index 80291afff3ea..0a31e4268dfb 100644
@@ -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