mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Ferdinand Blomqvist <ferdinand.blomqvist@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/7] rslib: Fix decoding of shortened codes
Date: Mon, 17 Jun 2019 22:46:18 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1906172244450.1963@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20190330182947.8823-3-ferdinand.blomqvist@gmail.com>

Ferdinand,

On Sat, 30 Mar 2019, Ferdinand Blomqvist wrote:

> The decoder is broken. It only works with full length codes.

A short explanation what is missing and what is done to fix it would be
appreciated.

> Signed-off-by: Ferdinand Blomqvist <ferdinand.blomqvist@gmail.com>
> ---
>  lib/reed_solomon/decode_rs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/reed_solomon/decode_rs.c b/lib/reed_solomon/decode_rs.c
> index 1db74eb098d0..3313bf944ff1 100644
> --- a/lib/reed_solomon/decode_rs.c
> +++ b/lib/reed_solomon/decode_rs.c
> @@ -99,9 +99,9 @@
>  	if (no_eras > 0) {
>  		/* Init lambda to be the erasure locator polynomial */
>  		lambda[1] = alpha_to[rs_modnn(rs,
> -					      prim * (nn - 1 - eras_pos[0]))];
> +					prim * (nn - 1 - (eras_pos[0] + pad)))];
>  		for (i = 1; i < no_eras; i++) {
> -			u = rs_modnn(rs, prim * (nn - 1 - eras_pos[i]));
> +			u = rs_modnn(rs, prim * (nn - 1 - (eras_pos[i] + pad)));
>  			for (j = i + 1; j > 0; j--) {
>  				tmp = index_of[lambda[j - 1]];
>  				if (tmp != nn) {

Code looks fine as is.

Thanks,

	tglx

  reply	other threads:[~2019-06-17 20:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30 18:29 [RFC PATCH 0/7] rslib: RS decoder is severely broken Ferdinand Blomqvist
2019-03-30 18:29 ` [RFC PATCH 1/7] rslib: Add tests for the encoder and decoder Ferdinand Blomqvist
2019-06-17 20:44   ` Thomas Gleixner
2019-03-30 18:29 ` [RFC PATCH 2/7] rslib: Fix decoding of shortened codes Ferdinand Blomqvist
2019-06-17 20:46   ` Thomas Gleixner [this message]
2019-03-30 18:29 ` [RFC PATCH 3/7] rslib: decode_rs: Fix length parameter check Ferdinand Blomqvist
2019-06-17 20:46   ` Thomas Gleixner
2019-03-30 18:29 ` [RFC PATCH 4/7] rslib: decode_rs: code cleanup Ferdinand Blomqvist
2019-06-17 20:47   ` Thomas Gleixner
2019-03-30 18:29 ` [RFC PATCH 5/7] rslib: Fix handling of of caller provided syndrome Ferdinand Blomqvist
2019-06-17 20:49   ` Thomas Gleixner
2019-03-30 18:29 ` [RFC PATCH 6/7] rslib: Update documentation Ferdinand Blomqvist
2019-06-17 20:49   ` Thomas Gleixner
2019-03-30 18:29 ` [RFC PATCH 7/7] rslib: Fix remaining decoder flaws Ferdinand Blomqvist
2019-06-17 21:00   ` Thomas Gleixner
2019-06-20 12:09     ` Ferdinand Blomqvist
2019-04-04 11:24 ` [RFC PATCH 0/7] rslib: RS decoder is severely broken Thomas Gleixner
2019-05-09 15:09   ` Ferdinand Blomqvist
2019-05-24  7:25     ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1906172244450.1963@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=ferdinand.blomqvist@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®