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

[PATCH v3 6/7] xz: move s->lzma.len = 0 initialization to lzma_reset()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Mar 2022 11:06:58 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0H0YRL04KECEnhSZHc0txOpsgQMjHkGgxeFv8W2+jqE=; b=DjkSOgdZ9TDmZeuR6EdqyvLJ79AYTZSnUHFvXHWanLZV1a5ZdJNBGXrJqcfitEJQ5r68Ri14Ri3MFF9wDYjZEWOMq4KgiVaZ/LY4l4rJyIDLCEx4wXhZSswNnyuuhmapCTn1+9F9ynr46dOyUde+l8NvLW8aBUd1vUsCNE6/oQgsrV2eRZzkO/Qf5e7inHwfY82F06wEaMvBnoeQ8YRrxqsKoJyMB9dKP1uE7p+FNfLMl4oAO+wdHLAWGY6OrKtHDdwaoth/jK7Q4aWIvab572bq0Lv443z4trdOBfySvvU7bsrjEK1QJvFodBSqXc+0kR4tb463IwJyHFydFywboQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j6SgIZsTvZXCcIpSDIrmBMtd5W6kDDHZ0YiUuDOFr5CntfUP41C28cqFxZ7QDTO1hPX32ojBvY1g1Y21aY1kADusU3S/oPorvP9kOwm5VItzNvN6UyLU6ZyuyvzVID93kbNp/Xo9PJQ0s062KEuG597o9U1+vj/OoOOKIvvRyqyk3nQYvXglMNcVcA4LViIERW2js14sKPbmE/accPYfzGMqGPkLqfr7ddJE9jW/acU164DcCXqw/wOEB1OUMhe8YGnL8IOkknM/0ILdxS1oXR2fIpOu8Hkeuvzz7WkaPxoil+cYkbf1rPj09WjcBraW6rt8/07o+VxQbv8oUz6mSQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 03 Mar 2022 10:07:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Lasse Collin <lasse.collin@xxxxxxxxxxx>

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>
[Linux commit: a98a25408b0e9b0264abcc3dabfafd9ff2ea1046]
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
---
v2: Retain one more S-o-b.

--- 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_
        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_lzma
                }
        }
 
-       s->lzma.len = 0;
-
        s->lzma2.sequence = SEQ_CONTROL;
        s->lzma2.need_dict_reset = true;
 




 


Rackspace

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