diff options
author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2013-09-11 17:26:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:59:45 -0400 |
commit | b34081f1cd59585451efaa69e1dff1b9507e6c89 (patch) | |
tree | b04c842059aeeed535e71e72570a29e2989ceeb3 | |
parent | 20b8875abcf2daa1dda5cf70bd6369df5e85d4c1 (diff) |
lz4: fix compression/decompression signedness mismatch
LZ4 compression and decompression functions require different in
signedness input/output parameters: unsigned char for compression and
signed char for decompression.
Change decompression API to require "(const) unsigned char *".
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Kyungsik Lee <kyungsik.lee@lge.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yann Collet <yann.collet.73@gmail.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.h | 8 | ||||
-rw-r--r-- | lib/lz4/lz4_decompress.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/lz4.h b/include/linux/lz4.h index d21c13f10a64..4356686b0a39 100644 --- a/include/linux/lz4.h +++ b/include/linux/lz4.h | |||
@@ -67,8 +67,8 @@ int lz4hc_compress(const unsigned char *src, size_t src_len, | |||
67 | * note : Destination buffer must be already allocated. | 67 | * note : Destination buffer must be already allocated. |
68 | * slightly faster than lz4_decompress_unknownoutputsize() | 68 | * slightly faster than lz4_decompress_unknownoutputsize() |
69 | */ | 69 | */ |
70 | int lz4_decompress(const char *src, size_t *src_len, char *dest, | 70 | int lz4_decompress(const unsigned char *src, size_t *src_len, |
71 | size_t actual_dest_len); | 71 | unsigned char *dest, size_t actual_dest_len); |
72 | 72 | ||
73 | /* | 73 | /* |
74 | * lz4_decompress_unknownoutputsize() | 74 | * lz4_decompress_unknownoutputsize() |
@@ -82,6 +82,6 @@ int lz4_decompress(const char *src, size_t *src_len, char *dest, | |||
82 | * Error if return (< 0) | 82 | * Error if return (< 0) |
83 | * note : Destination buffer must be already allocated. | 83 | * note : Destination buffer must be already allocated. |
84 | */ | 84 | */ |
85 | int lz4_decompress_unknownoutputsize(const char *src, size_t src_len, | 85 | int lz4_decompress_unknownoutputsize(const unsigned char *src, size_t src_len, |
86 | char *dest, size_t *dest_len); | 86 | unsigned char *dest, size_t *dest_len); |
87 | #endif | 87 | #endif |
diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c index 411be80ddb46..df6839e3ce08 100644 --- a/lib/lz4/lz4_decompress.c +++ b/lib/lz4/lz4_decompress.c | |||
@@ -283,8 +283,8 @@ _output_error: | |||
283 | return (int) (-(((char *) ip) - source)); | 283 | return (int) (-(((char *) ip) - source)); |
284 | } | 284 | } |
285 | 285 | ||
286 | int lz4_decompress(const char *src, size_t *src_len, char *dest, | 286 | int lz4_decompress(const unsigned char *src, size_t *src_len, |
287 | size_t actual_dest_len) | 287 | unsigned char *dest, size_t actual_dest_len) |
288 | { | 288 | { |
289 | int ret = -1; | 289 | int ret = -1; |
290 | int input_len = 0; | 290 | int input_len = 0; |
@@ -302,8 +302,8 @@ exit_0: | |||
302 | EXPORT_SYMBOL(lz4_decompress); | 302 | EXPORT_SYMBOL(lz4_decompress); |
303 | #endif | 303 | #endif |
304 | 304 | ||
305 | int lz4_decompress_unknownoutputsize(const char *src, size_t src_len, | 305 | int lz4_decompress_unknownoutputsize(const unsigned char *src, size_t src_len, |
306 | char *dest, size_t *dest_len) | 306 | unsigned char *dest, size_t *dest_len) |
307 | { | 307 | { |
308 | int ret = -1; | 308 | int ret = -1; |
309 | int out_len = 0; | 309 | int out_len = 0; |