]> xenbits.xensource.com Git - xen.git/commitdiff
xen/gzip: Drop unused define checks
authorDaniel P. Smith <dpsmith@apertussolutions.com>
Wed, 17 Apr 2024 14:37:11 +0000 (10:37 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 18 Apr 2024 19:43:11 +0000 (20:43 +0100)
Drop various macros and checks which are never used.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/gzip/gunzip.c
xen/common/gzip/inflate.c

index 2c6eae167d5460eac0f7a4ba219349a13f250572..fdccaa9159d15f6380145e1cc719bec30156ad54 100644 (file)
@@ -22,8 +22,6 @@ static unsigned int __initdata inptr;
 /* Bytes in output buffer: */
 static unsigned int __initdata outcnt;
 
-#define OF(args)        args
-
 #define memzero(s, n)   memset((s), 0, (n))
 
 typedef unsigned char   uch;
index 58f263d9e852d8c64679dbbd3711c2c5ab737f70..fc9b466e0ceeb6060aafcf23908d63764850b0e8 100644 (file)
@@ -138,15 +138,15 @@ struct huft {
 
 
 /* Function prototypes */
-static int huft_build OF((unsigned *, unsigned, unsigned,
-                          const ush *, const ush *, struct huft **, int *));
-static int huft_free OF((struct huft *));
-static int inflate_codes OF((struct huft *, struct huft *, int, int));
-static int inflate_stored OF((void));
-static int inflate_fixed OF((void));
-static int inflate_dynamic OF((void));
-static int inflate_block OF((int *));
-static int inflate OF((void));
+static int huft_build(unsigned *, unsigned, unsigned,
+                      const ush *, const ush *, struct huft **, int *);
+static int huft_free(struct huft *);
+static int inflate_codes(struct huft *, struct huft *, int, int);
+static int inflate_stored(void);
+static int inflate_fixed(void);
+static int inflate_dynamic(void);
+static int inflate_block(int *);
+static int inflate(void);
 
 
 /* The inflate algorithm uses a sliding 32 K byte window on the uncompressed
@@ -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 ");
@@ -1096,9 +1081,6 @@ static int __init inflate(void)
     h = 0;
     do {
         hufts = 0;
-#ifdef ARCH_HAS_DECOMP_WDOG
-        arch_decomp_wdog();
-#endif
         r = inflate_block(&e);
         if (r)
             return r;