Skip to content

Commit 38cbae1

Browse files
fblomqviKAGA-KOKO
authored andcommitted
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
1 parent ef4d6a8 commit 38cbae1

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎lib/reed_solomon/reed_solomon.c‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@ EXPORT_SYMBOL_GPL(encode_rs8);
340340
* @data: data field of a given type
341341
* @par: received parity data field
342342
* @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)
344345
* @no_eras: number of erasures
345346
* @eras_pos: position of erasures, can be NULL
346347
* @invmsk: invert data mask (will be xored on data, not on parity!)
@@ -354,7 +355,8 @@ EXPORT_SYMBOL_GPL(encode_rs8);
354355
* decoding, so the caller has to ensure that decoder invocations are
355356
* serialized.
356357
*
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.
358360
*/
359361
int decode_rs8(struct rs_control *rsc, uint8_t *data, uint16_t *par, int len,
360362
uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk,
@@ -391,7 +393,8 @@ EXPORT_SYMBOL_GPL(encode_rs16);
391393
* @data: data field of a given type
392394
* @par: received parity data field
393395
* @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)
395398
* @no_eras: number of erasures
396399
* @eras_pos: position of erasures, can be NULL
397400
* @invmsk: invert data mask (will be xored on data, not on parity!)
@@ -403,7 +406,8 @@ EXPORT_SYMBOL_GPL(encode_rs16);
403406
* decoding, so the caller has to ensure that decoder invocations are
404407
* serialized.
405408
*
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.
407411
*/
408412
int decode_rs16(struct rs_control *rsc, uint16_t *data, uint16_t *par, int len,
409413
uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk,

0 commit comments

Comments
 (0)