]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rslib: decode_rs: Code cleanup
authorFerdinand Blomqvist <ferdinand.blomqvist@gmail.com>
Thu, 20 Jun 2019 14:10:36 +0000 (17:10 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 26 Jun 2019 12:55:46 +0000 (14:55 +0200)
Nothing useful was done after the finish label when count is negative so
return directly instead of jumping to finish.

Signed-off-by: Ferdinand Blomqvist <ferdinand.blomqvist@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190620141039.9874-5-ferdinand.blomqvist@gmail.com
lib/reed_solomon/decode_rs.c

index 22006eaa41e65c28bd89a9fbfb9ed111032487f6..78629bbe6590bf47b39534f3833191ba99833f43 100644 (file)
@@ -88,8 +88,7 @@
                /* if syndrome is zero, data[] is a codeword and there are no
                 * errors to correct. So return data[] unmodified
                 */
-               count = 0;
-               goto finish;
+               return 0;
        }
 
  decode:
                 * deg(lambda) unequal to number of roots => uncorrectable
                 * error detected
                 */
-               count = -EBADMSG;
-               goto finish;
+               return -EBADMSG;
        }
        /*
         * Compute err+eras evaluator poly omega(x) = s(x)*lambda(x) (modulo
                }
        }
 
-finish:
        if (eras_pos != NULL) {
                for (i = 0; i < count; i++)
                        eras_pos[i] = loc[i] - pad;