Skip to content

Commit

Permalink
lib: lz4: define LZ4_decompress_safe_partial
Browse files Browse the repository at this point in the history
Fixes the following compilation error:
../fs/erofs/decompressor.c:160:8: error: implicit declaration of function 'LZ4_decompress_safe_partial' [-Werror,-Wimplicit-function-declaration]
        ret = LZ4_decompress_safe_partial(src + inputmargin, out,
  • Loading branch information
Official-Ayrton990 committed Sep 5, 2022
1 parent e6f3a7a commit c0c7f4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions include/linux/lz4.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ int LZ4_decompress_fast(const char *source, char *dest, int originalSize);
int LZ4_decompress_safe(const char *source, char *dest, int compressedSize,
int maxDecompressedSize);

#if 0
/**
* LZ4_decompress_safe_partial() - Decompress a block of size 'compressedSize'
* at position 'source' into buffer 'dest'
Expand All @@ -322,9 +321,8 @@ int LZ4_decompress_safe(const char *source, char *dest, int compressedSize,
* or a negative result in case of error
*
*/
static int LZ4_decompress_safe_partial(const char *source, char *dest,
int LZ4_decompress_safe_partial(const char *source, char *dest,
int compressedSize, int targetOutputSize, int maxDecompressedSize);
#endif

/*-************************************************************************
* LZ4 HC Compression
Expand Down
4 changes: 1 addition & 3 deletions lib/lz4/lz4_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,16 +691,14 @@ int LZ4_decompress_safe(const char *source, char *dest,
noDict, (BYTE *)dest, NULL, 0);
}

#if 0
static int LZ4_decompress_safe_partial(const char *src, char *dst,
int LZ4_decompress_safe_partial(const char *src, char *dst,
int compressedSize, int targetOutputSize, int dstCapacity)
{
dstCapacity = min(targetOutputSize, dstCapacity);
return LZ4_decompress_generic(src, dst, compressedSize, dstCapacity,
endOnInputSize, partial_decode,
noDict, (BYTE *)dst, NULL, 0);
}
#endif

int LZ4_decompress_fast(const char *source, char *dest, int originalSize)
{
Expand Down

0 comments on commit c0c7f4b

Please sign in to comment.