]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[linux-kernel] Fix unused variable warnings with malloc, calloc, and free
authorNick Terrell <terrelln@fb.com>
Wed, 23 Sep 2020 19:54:10 +0000 (12:54 -0700)
committerNick Terrell <terrelln@fb.com>
Wed, 23 Sep 2020 19:59:57 +0000 (12:59 -0700)
contrib/linux-kernel/zstd_deps.h

index d4ea0b2a4d4a2d151b4c784fd8f8f88bdd4d217b..44ec0328f8e8db016ac4905b54d035d38e33db1c 100644 (file)
@@ -56,9 +56,9 @@ typedef int64_t  S64;
 #ifndef ZSTD_DEPS_MALLOC
 #define ZSTD_DEPS_MALLOC
 
-#define ZSTD_malloc(s) (NULL)
-#define ZSTD_free(p) ((void)0)
-#define ZSTD_calloc(n,s) (NULL)
+#define ZSTD_malloc(s) ({ (void)(s); NULL; })
+#define ZSTD_free(p) ((void)(p))
+#define ZSTD_calloc(n,s) ({ (void)(n); (void)(s); NULL; })
 
 #endif /* ZSTD_DEPS_MALLOC */
 #endif /* ZSTD_DEPS_NEED_MALLOC */