aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reed_solomon
diff options
context:
space:
mode:
authorFerdinand Blomqvist <ferdinand.blomqvist@gmail.com>2019-06-20 10:10:38 -0400
committerThomas Gleixner <tglx@linutronix.de>2019-06-26 08:55:47 -0400
commit38cbae1434f8f7bbd8eaf24b29a385a4b88938fb (patch)
treeb8b44d373749e3e0717c97dbf80ce5e1f309f4d9 /lib/reed_solomon
parentef4d6a8556b637ad27c8c2a2cff1dda3da38e9a9 (diff)
rslib: Update documentation
The decoder returns the number of corrected symbols, not bits. The caller provided syndrome must be in index form. 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-7-ferdinand.blomqvist@gmail.com
Diffstat (limited to 'lib/reed_solomon')
-rw-r--r--lib/reed_solomon/reed_solomon.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/reed_solomon/reed_solomon.c b/lib/reed_solomon/reed_solomon.c
index e5fdc8b9e856..bbc01bad3053 100644
--- a/lib/reed_solomon/reed_solomon.c
+++ b/lib/reed_solomon/reed_solomon.c
@@ -340,7 +340,8 @@ EXPORT_SYMBOL_GPL(encode_rs8);
340 * @data: data field of a given type 340 * @data: data field of a given type
341 * @par: received parity data field 341 * @par: received parity data field
342 * @len: data length 342 * @len: data length
343 * @s: syndrome data field (if NULL, syndrome is calculated) 343 * @s: syndrome data field, must be in index form
344 * (if NULL, syndrome is calculated)
344 * @no_eras: number of erasures 345 * @no_eras: number of erasures
345 * @eras_pos: position of erasures, can be NULL 346 * @eras_pos: position of erasures, can be NULL
346 * @invmsk: invert data mask (will be xored on data, not on parity!) 347 * @invmsk: invert data mask (will be xored on data, not on parity!)
@@ -354,7 +355,8 @@ EXPORT_SYMBOL_GPL(encode_rs8);
354 * decoding, so the caller has to ensure that decoder invocations are 355 * decoding, so the caller has to ensure that decoder invocations are
355 * serialized. 356 * serialized.
356 * 357 *
357 * Returns the number of corrected bits or -EBADMSG for uncorrectable errors. 358 * Returns the number of corrected symbols or -EBADMSG for uncorrectable
359 * errors. The count includes errors in the parity.
358 */ 360 */
359int decode_rs8(struct rs_control *rsc, uint8_t *data, uint16_t *par, int len, 361int decode_rs8(struct rs_control *rsc, uint8_t *data, uint16_t *par, int len,
360 uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, 362 uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk,
@@ -391,7 +393,8 @@ EXPORT_SYMBOL_GPL(encode_rs16);
391 * @data: data field of a given type 393 * @data: data field of a given type
392 * @par: received parity data field 394 * @par: received parity data field
393 * @len: data length 395 * @len: data length
394 * @s: syndrome data field (if NULL, syndrome is calculated) 396 * @s: syndrome data field, must be in index form
397 * (if NULL, syndrome is calculated)
395 * @no_eras: number of erasures 398 * @no_eras: number of erasures
396 * @eras_pos: position of erasures, can be NULL 399 * @eras_pos: position of erasures, can be NULL
397 * @invmsk: invert data mask (will be xored on data, not on parity!) 400 * @invmsk: invert data mask (will be xored on data, not on parity!)
@@ -403,7 +406,8 @@ EXPORT_SYMBOL_GPL(encode_rs16);
403 * decoding, so the caller has to ensure that decoder invocations are 406 * decoding, so the caller has to ensure that decoder invocations are
404 * serialized. 407 * serialized.
405 * 408 *
406 * Returns the number of corrected bits or -EBADMSG for uncorrectable errors. 409 * Returns the number of corrected symbols or -EBADMSG for uncorrectable
410 * errors. The count includes errors in the parity.
407 */ 411 */
408int decode_rs16(struct rs_control *rsc, uint16_t *data, uint16_t *par, int len, 412int decode_rs16(struct rs_control *rsc, uint16_t *data, uint16_t *par, int len,
409 uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, 413 uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk,