summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFerdinand Blomqvist <ferdinand.blomqvist@gmail.com>2019-06-20 16:10:36 +0200
committerThomas Gleixner <tglx@linutronix.de>2019-06-26 14:55:46 +0200
commit647cc9ece63fdba573a31bdafa54fb2d388c3c83 (patch)
tree2252c596b1a31b781e6309d0c3ae6c030a134e74 /lib
parentrslib: decode_rs: Fix length parameter check (diff)
downloadlinux-647cc9ece63fdba573a31bdafa54fb2d388c3c83.tar.xz
linux-647cc9ece63fdba573a31bdafa54fb2d388c3c83.zip
rslib: decode_rs: Code cleanup
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
Diffstat (limited to 'lib')
-rw-r--r--lib/reed_solomon/decode_rs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/reed_solomon/decode_rs.c b/lib/reed_solomon/decode_rs.c
index 22006eaa41e6..78629bbe6590 100644
--- a/lib/reed_solomon/decode_rs.c
+++ b/lib/reed_solomon/decode_rs.c
@@ -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:
@@ -202,8 +201,7 @@
* 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
@@ -261,7 +259,6 @@
}
}
-finish:
if (eras_pos != NULL) {
for (i = 0; i < count; i++)
eras_pos[i] = loc[i] - pad;