Re: [PATCH v3 next 05/10] lib: Add tests for mul_u64_u64_div_u64_roundup()
From: Uwe Kleine-König
Date: Thu Sep 18 2025 - 10:00:47 EST
Hello David,
On Tue, Jun 17, 2025 at 12:30:17AM -0400, Nicolas Pitre wrote:
> On Sat, 14 Jun 2025, David Laight wrote:
>
> > Replicate the existing mul_u64_u64_div_u64() test cases with round up.
> > Update the shell script that verifies the table, remove the comment
> > markers so that it can be directly pasted into a shell.
> >
> > Rename the divisor from 'c' to 'd' to match mul_u64_add_u64_div_u64().
> >
> > It any tests fail then fail the module load with -EINVAL.
> >
> > Signed-off-by: David Laight <david.laight.linux@xxxxxxxxx>
>
> I must withdraw my Reviewed-by here.
>
> > /*
> > * The above table can be verified with the following shell script:
> > - *
> > - * #!/bin/sh
> > - * sed -ne 's/^{ \+\(.*\), \+\(.*\), \+\(.*\), \+\(.*\) },$/\1 \2 \3 \4/p' \
> > - * lib/math/test_mul_u64_u64_div_u64.c |
> > - * while read a b c r; do
> > - * expected=$( printf "obase=16; ibase=16; %X * %X / %X\n" $a $b $c | bc )
> > - * given=$( printf "%X\n" $r )
> > - * if [ "$expected" = "$given" ]; then
> > - * echo "$a * $b / $c = $r OK"
> > - * else
> > - * echo "$a * $b / $c = $r is wrong" >&2
> > - * echo "should be equivalent to 0x$expected" >&2
> > - * exit 1
> > - * fi
> > - * done
> > +
> > +#!/bin/sh
> > +sed -ne 's/^{ \+\(.*\), \+\(.*\), \+\(.*\), \+\(.*\), \+\(.*\) },$/\1 \2 \3 \4 \5/p' \
> > + lib/math/test_mul_u64_u64_div_u64.c |
> > +while read a b d r d; do
>
> This "read a b d r d" is wrong and that breaks the script.
I think apart from that problem the series is fine, isn't it? Given that
I wait for some time to be able to use the mul_u64_u64_div_u64_roundup()
variant, I would very appreciate your effort to end in this patch set
going in. Do you plan to address this issue? If not, I offer to look
into it and create the next revision for this series.
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature