[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a31155a7-d7f4-2825-1e84-bb8a51815edd@infradead.org>
Date: Sat, 18 Jun 2022 18:29:18 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Zhang Boyang <zhangboyang.id@...il.com>,
linux-kernel@...r.kernel.org
Cc: Ferdinand Blomqvist <ferdinand.blomqvist@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Kees Cook <keescook@...omium.org>,
Ivan Djelic <ivan.djelic@...rot.com>,
Boris Brezillon <boris.brezillon@...tlin.com>,
Miquel Raynal <miquel.raynal@...tlin.com>
Subject: Re: [PATCH v2 4/5] rslib: Improve the performance of encode_rs.c
Hi--
On 6/17/22 07:46, Zhang Boyang wrote:
> Signed-off-by: Zhang Boyang <zhangboyang.id@...il.com>
> ---
> include/linux/rslib.h | 14 +++++++++++++-
> lib/reed_solomon/encode_rs.c | 21 ++++++++++-----------
> 2 files changed, 23 insertions(+), 12 deletions(-)
>
> diff --git a/include/linux/rslib.h b/include/linux/rslib.h
> index cd0b5a7a5698..44ec7c6f24b2 100644
> --- a/include/linux/rslib.h
> +++ b/include/linux/rslib.h
> @@ -110,7 +110,7 @@ void free_rs(struct rs_control *rs);
> /** modulo replacement for galois field arithmetics
> *
> * @rs: Pointer to the RS codec
> - * @x: the value to reduce
> + * @x: x >= 0 ; the value to reduce
> *
> * where
> * rs->mm = number of bits per symbol
> @@ -127,4 +127,16 @@ static inline int rs_modnn(struct rs_codec *rs, int x)
> return x;
> }
>
> +/** modulo replacement for galois field arithmetics
/**
* rs_modnn_fast() - modulo replacement for galois field arithmetics
> + *
> + * @rs: Pointer to the RS codec
> + * @x: 0 <= x < 2*nn ; the value to reduce
> + *
> + * Same as rs_modnn(x), but faster, at the cost of limited value range of @x
> +*/
> +static inline int rs_modnn_fast(struct rs_codec *rs, int x)
> +{
> + return x - rs->nn < 0 ? x : x - rs->nn;
> +}
> +
> #endif
--
~Randy
Powered by blists - more mailing lists