Skip to content

Commit 87c2ce3

Browse files
AdrianBunkLinus Torvalds
authored and
Linus Torvalds
committed
[PATCH] lib/zlib*: cleanups
This patch contains the following possible cleanups: - #if 0 the following unused functions: - zlib_deflate/deflate.c: zlib_deflateSetDictionary - zlib_deflate/deflate.c: zlib_deflateParams - zlib_deflate/deflate.c: zlib_deflateCopy - zlib_inflate/infblock.c: zlib_inflate_set_dictionary - zlib_inflate/infblock.c: zlib_inflate_blocks_sync_point - zlib_inflate/inflate_sync.c: zlib_inflateSync - zlib_inflate/inflate_sync.c: zlib_inflateSyncPoint - remove the following unneeded EXPORT_SYMBOL's: - zlib_deflate/deflate_syms.c: zlib_deflateCopy - zlib_deflate/deflate_syms.c: zlib_deflateParams - zlib_inflate/inflate_syms.c: zlib_inflateSync - zlib_inflate/inflate_syms.c: zlib_inflateSyncPoint Signed-off-by: Adrian Bunk <[email protected]> Cc: Matt Mackall <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3af1376 commit 87c2ce3

File tree

7 files changed

+29
-4
lines changed

7 files changed

+29
-4
lines changed

include/linux/zlib.h

+11
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,11 @@ extern int deflateInit2 (z_streamp strm,
442442
not perform any compression: this will be done by deflate().
443443
*/
444444

445+
#if 0
445446
extern int zlib_deflateSetDictionary (z_streamp strm,
446447
const Byte *dictionary,
447448
uInt dictLength);
449+
#endif
448450
/*
449451
Initializes the compression dictionary from the given byte sequence
450452
without producing any compressed output. This function must be called
@@ -478,7 +480,10 @@ extern int zlib_deflateSetDictionary (z_streamp strm,
478480
perform any compression: this will be done by deflate().
479481
*/
480482

483+
#if 0
481484
extern int zlib_deflateCopy (z_streamp dest, z_streamp source);
485+
#endif
486+
482487
/*
483488
Sets the destination stream as a complete copy of the source stream.
484489
@@ -511,7 +516,9 @@ static inline unsigned long deflateBound(unsigned long s)
511516
return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11;
512517
}
513518

519+
#if 0
514520
extern int zlib_deflateParams (z_streamp strm, int level, int strategy);
521+
#endif
515522
/*
516523
Dynamically update the compression level and compression strategy. The
517524
interpretation of level and strategy is as in deflateInit2. This can be
@@ -571,7 +578,9 @@ extern int zlib_inflateSetDictionary (z_streamp strm,
571578
inflate().
572579
*/
573580

581+
#if 0
574582
extern int zlib_inflateSync (z_streamp strm);
583+
#endif
575584
/*
576585
Skips invalid compressed data until a full flush point (see above the
577586
description of deflate with Z_FULL_FLUSH) can be found, or until all
@@ -636,7 +645,9 @@ extern int zlib_inflateInit2_ (z_streamp strm, int windowBits,
636645
#endif
637646

638647
extern const char * zlib_zError (int err);
648+
#if 0
639649
extern int zlib_inflateSyncPoint (z_streamp z);
650+
#endif
640651
extern const uLong * zlib_get_crc_table (void);
641652

642653
#endif /* _ZLIB_H */

lib/zlib_deflate/deflate.c

+6
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ int zlib_deflateInit2_(
255255
}
256256

257257
/* ========================================================================= */
258+
#if 0
258259
int zlib_deflateSetDictionary(
259260
z_streamp strm,
260261
const Byte *dictionary,
@@ -297,6 +298,7 @@ int zlib_deflateSetDictionary(
297298
if (hash_head) hash_head = 0; /* to make compiler happy */
298299
return Z_OK;
299300
}
301+
#endif /* 0 */
300302

301303
/* ========================================================================= */
302304
int zlib_deflateReset(
@@ -330,6 +332,7 @@ int zlib_deflateReset(
330332
}
331333

332334
/* ========================================================================= */
335+
#if 0
333336
int zlib_deflateParams(
334337
z_streamp strm,
335338
int level,
@@ -365,6 +368,7 @@ int zlib_deflateParams(
365368
s->strategy = strategy;
366369
return err;
367370
}
371+
#endif /* 0 */
368372

369373
/* =========================================================================
370374
* Put a short in the pending buffer. The 16-bit value is put in MSB order.
@@ -572,6 +576,7 @@ int zlib_deflateEnd(
572576
/* =========================================================================
573577
* Copy the source state to the destination state.
574578
*/
579+
#if 0
575580
int zlib_deflateCopy (
576581
z_streamp dest,
577582
z_streamp source
@@ -624,6 +629,7 @@ int zlib_deflateCopy (
624629
return Z_OK;
625630
#endif
626631
}
632+
#endif /* 0 */
627633

628634
/* ===========================================================================
629635
* Read a new buffer from the current input stream, update the adler32

lib/zlib_deflate/deflate_syms.c

-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ EXPORT_SYMBOL(zlib_deflateInit_);
1616
EXPORT_SYMBOL(zlib_deflateInit2_);
1717
EXPORT_SYMBOL(zlib_deflateEnd);
1818
EXPORT_SYMBOL(zlib_deflateReset);
19-
EXPORT_SYMBOL(zlib_deflateCopy);
20-
EXPORT_SYMBOL(zlib_deflateParams);
2119
MODULE_LICENSE("GPL");

lib/zlib_inflate/infblock.c

+4
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ int zlib_inflate_blocks_free(
338338
}
339339

340340

341+
#if 0
341342
void zlib_inflate_set_dictionary(
342343
inflate_blocks_statef *s,
343344
const Byte *d,
@@ -347,15 +348,18 @@ void zlib_inflate_set_dictionary(
347348
memcpy(s->window, d, n);
348349
s->read = s->write = s->window + n;
349350
}
351+
#endif /* 0 */
350352

351353

352354
/* Returns true if inflate is currently at the end of a block generated
353355
* by Z_SYNC_FLUSH or Z_FULL_FLUSH.
354356
* IN assertion: s != NULL
355357
*/
358+
#if 0
356359
int zlib_inflate_blocks_sync_point(
357360
inflate_blocks_statef *s
358361
)
359362
{
360363
return s->mode == LENS;
361364
}
365+
#endif /* 0 */

lib/zlib_inflate/infblock.h

+4
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,16 @@ extern int zlib_inflate_blocks_free (
3333
inflate_blocks_statef *,
3434
z_streamp);
3535

36+
#if 0
3637
extern void zlib_inflate_set_dictionary (
3738
inflate_blocks_statef *s,
3839
const Byte *d, /* dictionary */
3940
uInt n); /* dictionary length */
41+
#endif /* 0 */
4042

43+
#if 0
4144
extern int zlib_inflate_blocks_sync_point (
4245
inflate_blocks_statef *s);
46+
#endif /* 0 */
4347

4448
#endif /* _INFBLOCK_H */

lib/zlib_inflate/inflate_syms.c

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ EXPORT_SYMBOL(zlib_inflate);
1515
EXPORT_SYMBOL(zlib_inflateInit_);
1616
EXPORT_SYMBOL(zlib_inflateInit2_);
1717
EXPORT_SYMBOL(zlib_inflateEnd);
18-
EXPORT_SYMBOL(zlib_inflateSync);
1918
EXPORT_SYMBOL(zlib_inflateReset);
20-
EXPORT_SYMBOL(zlib_inflateSyncPoint);
2119
EXPORT_SYMBOL(zlib_inflateIncomp);
2220
MODULE_LICENSE("GPL");

lib/zlib_inflate/inflate_sync.c

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "infblock.h"
88
#include "infutil.h"
99

10+
#if 0
1011
int zlib_inflateSync(
1112
z_streamp z
1213
)
@@ -57,6 +58,7 @@ int zlib_inflateSync(
5758
z->state->mode = BLOCKS;
5859
return Z_OK;
5960
}
61+
#endif /* 0 */
6062

6163

6264
/* Returns true if inflate is currently at the end of a block generated
@@ -66,6 +68,7 @@ int zlib_inflateSync(
6668
* decompressing, PPP checks that at the end of input packet, inflate is
6769
* waiting for these length bytes.
6870
*/
71+
#if 0
6972
int zlib_inflateSyncPoint(
7073
z_streamp z
7174
)
@@ -74,6 +77,7 @@ int zlib_inflateSyncPoint(
7477
return Z_STREAM_ERROR;
7578
return zlib_inflate_blocks_sync_point(z->state->blocks);
7679
}
80+
#endif /* 0 */
7781

7882
/*
7983
* This subroutine adds the data at next_in/avail_in to the output history

0 commit comments

Comments
 (0)