[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <q168q017-9p30-69p2-o4o5-s6q1s1385o27@syhkavp.arg>
Date: Tue, 17 Jun 2025 00:30:17 -0400 (EDT)
From: Nicolas Pitre <nico@...xnic.net>
To: David Laight <david.laight.linux@...il.com>
cc: Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org,
u.kleine-koenig@...libre.com, Oleg Nesterov <oleg@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Biju Das <biju.das.jz@...renesas.com>
Subject: Re: [PATCH v3 next 05/10] lib: Add tests for
mul_u64_u64_div_u64_roundup()
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@...il.com>
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.
Nicolas
Powered by blists - more mailing lists