[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xz: move s->lzma.len = 0 initialization to lzma_reset()



commit 9a46de64b8e454ec02b2040265d93530ad909d9c
Author:     Lasse Collin <lasse.collin@xxxxxxxxxxx>
AuthorDate: Mon Mar 7 09:09:26 2022 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Mar 7 09:09:26 2022 +0100

    xz: move s->lzma.len = 0 initialization to lzma_reset()
    
    It's a more logical place even if the resetting needs to be done
    only once per LZMA2 stream (if lzma_reset() called in the middle
    of an LZMA2 stream, .len will already be 0).
    
    Link: https://lore.kernel.org/r/20211010213145.17462-4-xiang@xxxxxxxxxx
    Signed-off-by: Lasse Collin <lasse.collin@xxxxxxxxxxx>
    Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxxxxxxxxx>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
a98a25408b0e
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/common/xz/dec_lzma2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/common/xz/dec_lzma2.c b/xen/common/xz/dec_lzma2.c
index 3b60191ee6..027ca93ce9 100644
--- a/xen/common/xz/dec_lzma2.c
+++ b/xen/common/xz/dec_lzma2.c
@@ -791,6 +791,7 @@ static void __init lzma_reset(struct xz_dec_lzma2 *s)
        s->lzma.rep1 = 0;
        s->lzma.rep2 = 0;
        s->lzma.rep3 = 0;
+       s->lzma.len = 0;
 
        /*
         * All probabilities are initialized to the same value. This hack
@@ -1174,8 +1175,6 @@ XZ_EXTERN enum xz_ret __init xz_dec_lzma2_reset(struct 
xz_dec_lzma2 *s, uint8_t
                }
        }
 
-       s->lzma.len = 0;
-
        s->lzma2.sequence = SEQ_CONTROL;
        s->lzma2.need_dict_reset = true;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.