linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "C. Masloch" <pushbx@ulukai.org>
To: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Dave Rodgman <dave.rodgman@arm.com>, Willy Tarreau <w@1wt.eu>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 1/2] docs: lzo: fix first byte interpretation off-by-one
Date: Fri, 22 May 2020 16:10:39 +0200	[thread overview]
Message-ID: <20200522141040.1353769-1-pushbx@ulukai.org> (raw)

There was an error in the description of the initial byte's
interpretation. While "18..21" was listed as  "copy 0..3 literals",
it should actually be interpreted as "copy 1..4 literals".

The "byte - 17" part is correct. 17 would encode copying "zero"
literals, but does not occur. 18 encodes copying 1 literal,
19 then 2 literals, 20 for 3 literals, 21 for 4 literals.
The description should read "18..21" as "copy 1..4 literals".
Likewise, 22 indicates "copying 5 literals", not "4 literals".
However, the state is indeed always set to "byte - 17" (which
for 21 results in 4 too).

Signed-off-by: C. Masloch <pushbx@ulukai.org>
---
 Documentation/lzo.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/lzo.txt b/Documentation/lzo.txt
index ca9833289..f839d104d 100644
--- a/Documentation/lzo.txt
+++ b/Documentation/lzo.txt
@@ -108,12 +108,12 @@ Byte sequences
                 (version 1 only).
                 Otherwise, the bitstream version is 0.
 
-      18..21  : copy 0..3 literals
-                state = (byte - 17) = 0..3  [ copy <state> literals ]
+      18..21  : copy 1..4 literals
+                state = (byte - 17) = 1..4  [ copy <state> literals ]
                 skip byte
 
       22..255 : copy literal string
-                length = (byte - 17) = 4..238
+                length = (byte - 17) = 5..238
                 state = 4 [ don't copy extra literals ]
                 skip byte
 
-- 
2.26.2


             reply	other threads:[~2020-05-22 14:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 14:10 C. Masloch [this message]
2020-05-22 14:10 ` [PATCH 2/2] docs: lzo: fix incorrect statement about distance zero for EOS C. Masloch
2020-05-22 15:22   ` Dave Rodgman
2020-05-22 15:22 ` [PATCH 1/2] docs: lzo: fix first byte interpretation off-by-one Dave Rodgman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200522141040.1353769-1-pushbx@ulukai.org \
    --to=pushbx@ulukai.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=dave.rodgman@arm.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).