Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp781938ybd; Wed, 26 Jun 2019 06:06:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzj6wLzxGTQ/G1SBujsJ29Io0wd5+6BmB5nsbibBuPAAlfLOiCBI4beV3w9Fy30FO6ultMO X-Received: by 2002:a63:f346:: with SMTP id t6mr2978833pgj.203.1561554362352; Wed, 26 Jun 2019 06:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561554362; cv=none; d=google.com; s=arc-20160816; b=UKb9VjXYcZOYL2KmlbpsGkzxA2GtroTDKQRNHn0Z8/PEPqfuvZGGKL4vUA4CAY4YVG E/+ghFNiLIGa73XG3JOpOSPpp9+J48Im6a0g1J36hmWBdi9lJZ5tdsIc32AjSqhG9Nwa vBtt+M3M15/ccD+xVc9pVgcCVZ7l6TkGqaV6KL5008Y3ZJCAWjmSbkWBk9j9M2mrYh19 ipzT7zp6c0e165OnRpx6u45yTY7r571h7Qq0ceaf4EIfhWo5grl/1Uogeyb6mQgXtJge vlRiqQPs+sTJ1Jf4nAemcz+PWBYw3khkpXkyoTFfuUnOYmTdbfTg3lXHgnQD9d3RB485 ux6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=+s0u7aVGHVKAuL2mRa+TO0g52PQbU/sLVQya3nyFqBA=; b=rGE4oTJ8jqe+ZV3rnYoM2wunyF7n4KmsImWWk7WQSPyOHMsERm2rqocaebqw2fURtL gd5QsTVK6ONkLU2ApOYrG+cZeHved0BtlGbhZb37kCBoB2DmTydfb4QlGiVrUaJ07gVO UmdiIr9QX9zV61wPhgrH0hewj/FckPed4Urfb7O7Qp3zvRjbUVPyQLan4bx2Xmf3hvHi UJ95pfVjckrwq9gJiu32scivdsdqOOkKPIitA2SPhf3+arghGGO9nbRq33khSaSLoMJK ajA2uTWYvVjnos58GSQz/y4qsmSkH//mbE3i0ASTKlvCHMTzwfkmMJU7QCuVAgzzmBjs Z1/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=ohwjVenQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i18si16634196pfd.64.2019.06.26.06.05.46; Wed, 26 Jun 2019 06:06:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=ohwjVenQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727524AbfFZNE7 (ORCPT + 99 others); Wed, 26 Jun 2019 09:04:59 -0400 Received: from terminus.zytor.com ([198.137.202.136]:39221 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbfFZNE7 (ORCPT ); Wed, 26 Jun 2019 09:04:59 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x5QD4qA44114662 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 26 Jun 2019 06:04:52 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x5QD4qA44114662 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019061801; t=1561554293; bh=+s0u7aVGHVKAuL2mRa+TO0g52PQbU/sLVQya3nyFqBA=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=ohwjVenQ7tTqZZBCV8tTPke9zKqjjTY79khJ85nR5gf+3BK+8BGArK/c9hWoU4NMx +/L2LSDmIpGwiqgacYZRjaiNXs7OuqY04T6fzCOamaHqZG19zA5b84ILLLufW1LbmR PtATQaSmzRD1wyoofg7+E6uTyslez5KZhvSRSpWwW5kgVcQjFaxTHiJjvXZB3t49mg 2yK5kgBeg3sLuLMiA2pWnb93BIzQkDG/yXs9q76Vhe/NKMji8KdN43fNyqA42XJFoB IE3emWEkZmK/bZ2GwLwdDRE6hlg/XzqwO+Z1J+aYFG3Ow2KwZ4z77wycBOu2fbILgF HZJmWeWfjPaTg== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x5QD4pOZ4114659; Wed, 26 Jun 2019 06:04:51 -0700 Date: Wed, 26 Jun 2019 06:04:51 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Ferdinand Blomqvist Message-ID: Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, ferdinand.blomqvist@gmail.com, hpa@zytor.com Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de, ferdinand.blomqvist@gmail.com, hpa@zytor.com In-Reply-To: <20190620141039.9874-7-ferdinand.blomqvist@gmail.com> References: <20190620141039.9874-7-ferdinand.blomqvist@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/rslib] rslib: Update documentation Git-Commit-ID: 38cbae1434f8f7bbd8eaf24b29a385a4b88938fb X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=2.2 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_12_24,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF,FREEMAIL_FORGED_REPLYTO autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 38cbae1434f8f7bbd8eaf24b29a385a4b88938fb Gitweb: https://git.kernel.org/tip/38cbae1434f8f7bbd8eaf24b29a385a4b88938fb Author: Ferdinand Blomqvist AuthorDate: Thu, 20 Jun 2019 17:10:38 +0300 Committer: Thomas Gleixner CommitDate: Wed, 26 Jun 2019 14:55:47 +0200 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 Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20190620141039.9874-7-ferdinand.blomqvist@gmail.com --- lib/reed_solomon/reed_solomon.c | 12 ++++++++---- 1 file 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); * @data: data field of a given type * @par: received parity data field * @len: data length - * @s: syndrome data field (if NULL, syndrome is calculated) + * @s: syndrome data field, must be in index form + * (if NULL, syndrome is calculated) * @no_eras: number of erasures * @eras_pos: position of erasures, can be NULL * @invmsk: invert data mask (will be xored on data, not on parity!) @@ -354,7 +355,8 @@ EXPORT_SYMBOL_GPL(encode_rs8); * decoding, so the caller has to ensure that decoder invocations are * serialized. * - * Returns the number of corrected bits or -EBADMSG for uncorrectable errors. + * Returns the number of corrected symbols or -EBADMSG for uncorrectable + * errors. The count includes errors in the parity. */ int decode_rs8(struct rs_control *rsc, uint8_t *data, uint16_t *par, int len, uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, @@ -391,7 +393,8 @@ EXPORT_SYMBOL_GPL(encode_rs16); * @data: data field of a given type * @par: received parity data field * @len: data length - * @s: syndrome data field (if NULL, syndrome is calculated) + * @s: syndrome data field, must be in index form + * (if NULL, syndrome is calculated) * @no_eras: number of erasures * @eras_pos: position of erasures, can be NULL * @invmsk: invert data mask (will be xored on data, not on parity!) @@ -403,7 +406,8 @@ EXPORT_SYMBOL_GPL(encode_rs16); * decoding, so the caller has to ensure that decoder invocations are * serialized. * - * Returns the number of corrected bits or -EBADMSG for uncorrectable errors. + * Returns the number of corrected symbols or -EBADMSG for uncorrectable + * errors. The count includes errors in the parity. */ int decode_rs16(struct rs_control *rsc, uint16_t *data, uint16_t *par, int len, uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk,