aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Schmidt <4sschmid@informatik.uni-hamburg.de>2017-02-24 18:01:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-24 20:46:57 -0500
commit69c78423b8f439b077929410bdf8f88e7031b891 (patch)
treede63030f9e192be674f750915ef2c636f8a9e1ef
parentd21b5ff12df45a65bb220c7e8103a5f0f5609377 (diff)
lib/lz4: remove back-compat wrappers
Remove the functions introduced as wrappers for providing backwards compatibility to the prior LZ4 version. They're not needed anymore since there's no callers left. Link: http://lkml.kernel.org/r/1486321748-19085-6-git-send-email-4sschmid@informatik.uni-hamburg.de Signed-off-by: Sven Schmidt <4sschmid@informatik.uni-hamburg.de> Cc: Bongkyu Kim <bongkyu.kim@lge.com> Cc: Rui Salvaterra <rsalvaterra@gmail.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: David S. Miller <davem@davemloft.net> Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Kees Cook <keescook@chromium.org> Cc: Tony Luck <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/lz4.h69
-rw-r--r--lib/lz4/lz4_compress.c22
-rw-r--r--lib/lz4/lz4_decompress.c42
-rw-r--r--lib/lz4/lz4hc_compress.c23
4 files changed, 0 insertions, 156 deletions
diff --git a/include/linux/lz4.h b/include/linux/lz4.h
index 1b0f8ca0f9c8..394e3d9213b8 100644
--- a/include/linux/lz4.h
+++ b/include/linux/lz4.h
@@ -173,18 +173,6 @@ static inline int LZ4_compressBound(size_t isize)
173} 173}
174 174
175/** 175/**
176 * lz4_compressbound() - For backwards compatibility; see LZ4_compressBound
177 * @isize: Size of the input data
178 *
179 * Return: Max. size LZ4 may output in a "worst case" szenario
180 * (data not compressible)
181 */
182static inline int lz4_compressbound(size_t isize)
183{
184 return LZ4_COMPRESSBOUND(isize);
185}
186
187/**
188 * LZ4_compress_default() - Compress data from source to dest 176 * LZ4_compress_default() - Compress data from source to dest
189 * @source: source address of the original data 177 * @source: source address of the original data
190 * @dest: output buffer address of the compressed data 178 * @dest: output buffer address of the compressed data
@@ -257,20 +245,6 @@ int LZ4_compress_fast(const char *source, char *dest, int inputSize,
257int LZ4_compress_destSize(const char *source, char *dest, int *sourceSizePtr, 245int LZ4_compress_destSize(const char *source, char *dest, int *sourceSizePtr,
258 int targetDestSize, void *wrkmem); 246 int targetDestSize, void *wrkmem);
259 247
260/*
261 * lz4_compress() - For backward compatibility, see LZ4_compress_default
262 * @src: source address of the original data
263 * @src_len: size of the original data
264 * @dst: output buffer address of the compressed data. This requires 'dst'
265 * of size LZ4_COMPRESSBOUND
266 * @dst_len: is the output size, which is returned after compress done
267 * @workmem: address of the working memory.
268 *
269 * Return: Success if return 0, Error if return < 0
270 */
271int lz4_compress(const unsigned char *src, size_t src_len, unsigned char *dst,
272 size_t *dst_len, void *wrkmem);
273
274/*-************************************************************************ 248/*-************************************************************************
275 * Decompression Functions 249 * Decompression Functions
276 **************************************************************************/ 250 **************************************************************************/
@@ -346,34 +320,6 @@ int LZ4_decompress_safe(const char *source, char *dest, int compressedSize,
346int LZ4_decompress_safe_partial(const char *source, char *dest, 320int LZ4_decompress_safe_partial(const char *source, char *dest,
347 int compressedSize, int targetOutputSize, int maxDecompressedSize); 321 int compressedSize, int targetOutputSize, int maxDecompressedSize);
348 322
349/*
350 * lz4_decompress_unknownoutputsize() - For backwards compatibility,
351 * see LZ4_decompress_safe
352 * @src: source address of the compressed data
353 * @src_len: is the input size, therefore the compressed size
354 * @dest: output buffer address of the decompressed data
355 * which must be already allocated
356 * @dest_len: is the max size of the destination buffer, which is
357 * returned with actual size of decompressed data after decompress done
358 *
359 * Return: Success if return 0, Error if return (< 0)
360 */
361int lz4_decompress_unknownoutputsize(const unsigned char *src, size_t src_len,
362 unsigned char *dest, size_t *dest_len);
363
364/**
365 * lz4_decompress() - For backwards cocmpatibility, see LZ4_decompress_fast
366 * @src: source address of the compressed data
367 * @src_len: is the input size, which is returned after decompress done
368 * @dest: output buffer address of the decompressed data,
369 * which must be already allocated
370 * @actual_dest_len: is the size of uncompressed data, supposing it's known
371 *
372 * Return: Success if return 0, Error if return (< 0)
373 */
374int lz4_decompress(const unsigned char *src, size_t *src_len,
375 unsigned char *dest, size_t actual_dest_len);
376
377/*-************************************************************************ 323/*-************************************************************************
378 * LZ4 HC Compression 324 * LZ4 HC Compression
379 **************************************************************************/ 325 **************************************************************************/
@@ -401,21 +347,6 @@ int LZ4_compress_HC(const char *src, char *dst, int srcSize, int dstCapacity,
401 int compressionLevel, void *wrkmem); 347 int compressionLevel, void *wrkmem);
402 348
403/** 349/**
404 * lz4hc_compress() - For backwards compatibility, see LZ4_compress_HC
405 * @src: source address of the original data
406 * @src_len: size of the original data
407 * @dst: output buffer address of the compressed data. This requires 'dst'
408 * of size LZ4_COMPRESSBOUND.
409 * @dst_len: is the output size, which is returned after compress done
410 * @wrkmem: address of the working memory.
411 * This requires 'workmem' of size LZ4HC_MEM_COMPRESS.
412 *
413 * Return : Success if return 0, Error if return (< 0)
414 */
415int lz4hc_compress(const unsigned char *src, size_t src_len, unsigned char *dst,
416 size_t *dst_len, void *wrkmem);
417
418/**
419 * LZ4_resetStreamHC() - Init an allocated 'LZ4_streamHC_t' structure 350 * LZ4_resetStreamHC() - Init an allocated 'LZ4_streamHC_t' structure
420 * @streamHCPtr: pointer to the 'LZ4_streamHC_t' structure 351 * @streamHCPtr: pointer to the 'LZ4_streamHC_t' structure
421 * @compressionLevel: Recommended values are between 4 and 9, although any 352 * @compressionLevel: Recommended values are between 4 and 9, although any
diff --git a/lib/lz4/lz4_compress.c b/lib/lz4/lz4_compress.c
index 53f313f05185..cc7b6d4cc7c7 100644
--- a/lib/lz4/lz4_compress.c
+++ b/lib/lz4/lz4_compress.c
@@ -936,27 +936,5 @@ int LZ4_compress_fast_continue(LZ4_stream_t *LZ4_stream, const char *source,
936} 936}
937EXPORT_SYMBOL(LZ4_compress_fast_continue); 937EXPORT_SYMBOL(LZ4_compress_fast_continue);
938 938
939/*-******************************
940 * For backwards compatibility
941 ********************************/
942int lz4_compress(const unsigned char *src, size_t src_len, unsigned char *dst,
943 size_t *dst_len, void *wrkmem) {
944 *dst_len = LZ4_compress_default(src, dst, src_len,
945 *dst_len, wrkmem);
946
947 /*
948 * Prior lz4_compress will return -1 in case of error
949 * and 0 on success
950 * while new LZ4_compress_fast/default
951 * returns 0 in case of error
952 * and the output length on success
953 */
954 if (!*dst_len)
955 return -1;
956 else
957 return 0;
958}
959EXPORT_SYMBOL(lz4_compress);
960
961MODULE_LICENSE("Dual BSD/GPL"); 939MODULE_LICENSE("Dual BSD/GPL");
962MODULE_DESCRIPTION("LZ4 compressor"); 940MODULE_DESCRIPTION("LZ4 compressor");
diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c
index b5e00a19a7b4..bd3574312b82 100644
--- a/lib/lz4/lz4_decompress.c
+++ b/lib/lz4/lz4_decompress.c
@@ -493,46 +493,6 @@ int LZ4_decompress_fast_usingDict(const char *source, char *dest,
493 originalSize, 0, dictStart, dictSize); 493 originalSize, 0, dictStart, dictSize);
494} 494}
495 495
496/*-******************************
497 * For backwards compatibility
498 ********************************/
499int lz4_decompress_unknownoutputsize(const unsigned char *src,
500 size_t src_len, unsigned char *dest, size_t *dest_len) {
501 *dest_len = LZ4_decompress_safe(src, dest,
502 src_len, *dest_len);
503
504 /*
505 * Prior lz4_decompress_unknownoutputsize will return
506 * 0 for success and a negative result for error
507 * new LZ4_decompress_safe returns
508 * - the length of data read on success
509 * - and also a negative result on error
510 * meaning when result > 0, we just return 0 here
511 */
512 if (src_len > 0)
513 return 0;
514 else
515 return -1;
516}
517
518int lz4_decompress(const unsigned char *src, size_t *src_len,
519 unsigned char *dest, size_t actual_dest_len) {
520 *src_len = LZ4_decompress_fast(src, dest, actual_dest_len);
521
522 /*
523 * Prior lz4_decompress will return
524 * 0 for success and a negative result for error
525 * new LZ4_decompress_fast returns
526 * - the length of data read on success
527 * - and also a negative result on error
528 * meaning when result > 0, we just return 0 here
529 */
530 if (*src_len > 0)
531 return 0;
532 else
533 return -1;
534}
535
536#ifndef STATIC 496#ifndef STATIC
537EXPORT_SYMBOL(LZ4_decompress_safe); 497EXPORT_SYMBOL(LZ4_decompress_safe);
538EXPORT_SYMBOL(LZ4_decompress_safe_partial); 498EXPORT_SYMBOL(LZ4_decompress_safe_partial);
@@ -542,8 +502,6 @@ EXPORT_SYMBOL(LZ4_decompress_safe_continue);
542EXPORT_SYMBOL(LZ4_decompress_fast_continue); 502EXPORT_SYMBOL(LZ4_decompress_fast_continue);
543EXPORT_SYMBOL(LZ4_decompress_safe_usingDict); 503EXPORT_SYMBOL(LZ4_decompress_safe_usingDict);
544EXPORT_SYMBOL(LZ4_decompress_fast_usingDict); 504EXPORT_SYMBOL(LZ4_decompress_fast_usingDict);
545EXPORT_SYMBOL(lz4_decompress_unknownoutputsize);
546EXPORT_SYMBOL(lz4_decompress);
547 505
548MODULE_LICENSE("Dual BSD/GPL"); 506MODULE_LICENSE("Dual BSD/GPL");
549MODULE_DESCRIPTION("LZ4 decompressor"); 507MODULE_DESCRIPTION("LZ4 decompressor");
diff --git a/lib/lz4/lz4hc_compress.c b/lib/lz4/lz4hc_compress.c
index e1fbf1561e55..176f03b83e56 100644
--- a/lib/lz4/lz4hc_compress.c
+++ b/lib/lz4/lz4hc_compress.c
@@ -765,28 +765,5 @@ int LZ4_saveDictHC(
765} 765}
766EXPORT_SYMBOL(LZ4_saveDictHC); 766EXPORT_SYMBOL(LZ4_saveDictHC);
767 767
768/*-******************************
769 * For backwards compatibility
770 ********************************/
771int lz4hc_compress(const unsigned char *src, size_t src_len,
772 unsigned char *dst, size_t *dst_len, void *wrkmem)
773{
774 *dst_len = LZ4_compress_HC(src, dst, src_len,
775 *dst_len, LZ4HC_DEFAULT_CLEVEL, wrkmem);
776
777 /*
778 * Prior lz4hc_compress will return -1 in case of error
779 * and 0 on success
780 * while new LZ4_compress_HC
781 * returns 0 in case of error
782 * and the output length on success
783 */
784 if (!*dst_len)
785 return -1;
786 else
787 return 0;
788}
789EXPORT_SYMBOL(lz4hc_compress);
790
791MODULE_LICENSE("Dual BSD/GPL"); 768MODULE_LICENSE("Dual BSD/GPL");
792MODULE_DESCRIPTION("LZ4 HC compressor"); 769MODULE_DESCRIPTION("LZ4 HC compressor");