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

[PATCH v2 1/6] gzip: drop unused define checks


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Wed, 17 Apr 2024 10:37:11 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1713364648; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=8+kt8iMSGPzyGhHCaIhcFst+HrU8xeK5CDMlGfOE44I=; b=S0jnYwjsyEYHuvpb2LknHXGOqECg3e8mG0+gC70PCB+fH0astSedWAjg0LKBAueGh9cZphvBQ92h+sOUH6ZJiklZBGFwp5QXh/jV188haLefNx8ci+MYblz01mFirEaBAu/34M/gTMQ8to032UuKY55vOIHYuHHQ2GyWnbPdKjs=
  • Arc-seal: i=1; a=rsa-sha256; t=1713364648; cv=none; d=zohomail.com; s=zohoarc; b=fiW719O+jy6AkTMMrnoTdKzP/YeOnARtF3DjH02aysdQTY/TSWIARARBKKpdp6JF0e9hc6Ba0N8sU8vgqXx4Fei3990JSGoBlcfa0G1mwb1HB/RRN9Tjy4Nkk5C8PIzEzgsJwDF4ObGMjDcOsXhoNOWEqpZlsDzYcgZb0OUKmQw=
  • Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivered-to: dpsmith@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 17 Apr 2024 14:37:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Dropping the define checks for PKZIP_BUG_WORKAROUND and NOMEMCPY define as they
never are set.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
 xen/common/gzip/inflate.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/xen/common/gzip/inflate.c b/xen/common/gzip/inflate.c
index 58f263d9e852..e95db2de4d9b 100644
--- a/xen/common/gzip/inflate.c
+++ b/xen/common/gzip/inflate.c
@@ -661,7 +661,6 @@ static int __init inflate_codes(
                 /* do the copy */
                 do {
                     n -= (e = (e = WSIZE - ((d &= WSIZE-1) > w ? d : w)) > n ? 
n : e);
-#if !defined(NOMEMCPY) && !defined(DEBUG)
                     if (w - d >= e)         /* (this test assumes unsigned 
comparison) */
                     {
                         memcpy(slide + w, slide + d, e);
@@ -669,7 +668,6 @@ static int __init inflate_codes(
                         d += e;
                     }
                     else                      /* do it slow to avoid memcpy() 
overlap */
-#endif /* !NOMEMCPY */
                         do {
                             slide[w++] = slide[d++];
                             Tracevv((stderr, "%c", slide[w-1]));
@@ -845,11 +843,7 @@ static int noinline __init inflate_dynamic(void)
 
     DEBG("<dyn");
 
-#ifdef PKZIP_BUG_WORKAROUND
-    ll = malloc(sizeof(*ll) * (288+32));  /* literal/length and distance code 
lengths */
-#else
     ll = malloc(sizeof(*ll) * (286+30));  /* literal/length and distance code 
lengths */
-#endif
 
     if (ll == NULL)
         return 1;
@@ -869,11 +863,7 @@ static int noinline __init inflate_dynamic(void)
         NEEDBITS(4)
         nb = 4 + ((unsigned)b & 0xf);         /* number of bit length codes */
     DUMPBITS(4)
-#ifdef PKZIP_BUG_WORKAROUND
-        if (nl > 288 || nd > 32)
-#else
             if (nl > 286 || nd > 30)
-#endif
             {
                 ret = 1;             /* bad lengths */
                 goto out;
@@ -989,16 +979,11 @@ static int noinline __init inflate_dynamic(void)
         DEBG("dyn5d ");
         if (i == 1) {
             error("incomplete distance tree");
-#ifdef PKZIP_BUG_WORKAROUND
-            i = 0;
-        }
-#else
         huft_free(td);
     }
     huft_free(tl);
     ret = i;                   /* incomplete code set */
     goto out;
-#endif
 }
 
 DEBG("dyn6 ");
-- 
2.30.2




 


Rackspace

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