diff options
author | Pali Rohár <pali@kernel.org> | 2022-07-27 17:24:23 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-08-10 13:46:55 -0400 |
commit | 3ff4675d732291002d947f8837504376bfa8a43c (patch) | |
tree | a94bdb482b29912bf18b838bcefa038fc78e17b3 /lib | |
parent | 1bacff9ef665a40d3151147b1798fa1f86700a8f (diff) | |
download | u-boot-3ff4675d732291002d947f8837504376bfa8a43c.zip u-boot-3ff4675d732291002d947f8837504376bfa8a43c.tar.gz u-boot-3ff4675d732291002d947f8837504376bfa8a43c.tar.bz2 |
lz4: Fix compile warning comparison of distinct pointer types
In file included from include/linux/bitops.h:22,
from include/log.h:15,
from include/linux/printk.h:4,
from include/common.h:20,
from lib/lz4_wrapper.c:6:
lib/lz4_wrapper.c: In function ‘ulz4fn’:
include/linux/kernel.h:184:17: warning: comparison of distinct pointer types lacks a cast
(void) (&_min1 == &_min2); \
^~
lib/lz4_wrapper.c:104:18: note: in expansion of macro ‘min’
size_t size = min((ptrdiff_t)block_size, end - out);
^~~
Signed-off-by: Pali Rohár <pali@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4_wrapper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lz4_wrapper.c b/lib/lz4_wrapper.c index 0d2a365..67dea2f 100644 --- a/lib/lz4_wrapper.c +++ b/lib/lz4_wrapper.c @@ -80,7 +80,7 @@ int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn) } if (block_header & LZ4F_BLOCKUNCOMPRESSED_FLAG) { - size_t size = min((ptrdiff_t)block_size, end - out); + size_t size = min((ptrdiff_t)block_size, (ptrdiff_t)(end - out)); memcpy(out, in, size); out += size; if (size < block_size) { |