[PATCH] dpaa2-eth: Use proper division helper in dpaa2_dbg_ch_show

1 view
Skip to first unread message

Nathan Chancellor

unread,
Apr 28, 2020, 1:43:23 PM4/28/20
to Ioana Ciornei, Ioana Radulescu, David S. Miller, net...@vger.kernel.org, linux-...@vger.kernel.org, clang-bu...@googlegroups.com, Nathan Chancellor
When building arm32 allmodconfig:

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

frames and cdan are both of type __u64 (unsigned long long) so we need
to use div64_u64 to avoid this issues.

Fixes: 460fd830dd9d ("dpaa2-eth: add channel stat to debugfs")
Link: https://github.com/ClangBuiltLinux/linux/issues/1012
Signed-off-by: Nathan Chancellor <natecha...@gmail.com>
---
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);
}


base-commit: 0fd02a5d3eb7020a7e1801f8d7f01891071c85e4
--
2.26.2

Nick Desaulniers

unread,
Apr 28, 2020, 2:34:24 PM4/28/20
to Nathan Chancellor, Ioana Ciornei, Ioana Radulescu, David S. Miller, Network Development, LKML, clang-built-linux
On Tue, Apr 28, 2020 at 10:43 AM Nathan Chancellor
<natecha...@gmail.com> wrote:
>
> When building arm32 allmodconfig:
>
> ERROR: modpost: "__aeabi_uldivmod"
> [drivers/net/ethernet/freescale/dpaa2/fsl-dpaa2-eth.ko] undefined!
>
> frames and cdan are both of type __u64 (unsigned long long) so we need
> to use div64_u64 to avoid this issues.
>
> Fixes: 460fd830dd9d ("dpaa2-eth: add channel stat to debugfs")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1012
> Signed-off-by: Nathan Chancellor <natecha...@gmail.com>

Don't forget reported by tags to show some love to our bots! Thanks
for the patch.
Reported-by: kernelci.org bot <b...@kernelci.org>
Reviewed-by: Nick Desaulniers <ndesau...@google.com>

> ---
> 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);
> }
>
>
> base-commit: 0fd02a5d3eb7020a7e1801f8d7f01891071c85e4
> --
> 2.26.2
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-li...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200428174221.2040849-1-natechancellor%40gmail.com.



--
Thanks,
~Nick Desaulniers

David Miller

unread,
Apr 28, 2020, 5:32:09 PM4/28/20
to ndesau...@google.com, natecha...@gmail.com, ioana....@nxp.com, ruxandra....@nxp.com, net...@vger.kernel.org, linux-...@vger.kernel.org, clang-bu...@googlegroups.com
From: Nick Desaulniers <ndesau...@google.com>
Date: Tue, 28 Apr 2020 11:34:11 -0700

> On Tue, Apr 28, 2020 at 10:43 AM Nathan Chancellor
> <natecha...@gmail.com> wrote:
>>
>> When building arm32 allmodconfig:
>>
>> ERROR: modpost: "__aeabi_uldivmod"
>> [drivers/net/ethernet/freescale/dpaa2/fsl-dpaa2-eth.ko] undefined!
>>
>> frames and cdan are both of type __u64 (unsigned long long) so we need
>> to use div64_u64 to avoid this issues.
>>
>> Fixes: 460fd830dd9d ("dpaa2-eth: add channel stat to debugfs")
>> Link: https://github.com/ClangBuiltLinux/linux/issues/1012
>> Signed-off-by: Nathan Chancellor <natecha...@gmail.com>
>
> Don't forget reported by tags to show some love to our bots! Thanks
> for the patch.
> Reported-by: kernelci.org bot <b...@kernelci.org>
> Reviewed-by: Nick Desaulniers <ndesau...@google.com>

Applied to net-next, thanks.
Reply all
Reply to author
Forward
0 new messages