lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 14 Nov 2018 21:27:19 -0300
From:   Adeodato Simó <dato@....com.org.es>
To:     Nick Terrell <terrelln@...com>
Cc:     Chris Mason <clm@...com>, kernel-janitors@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] lib/zstd: mark some internal functions as static with ZSTD_STATIC

Use ZSTD_STATIC instead of vanilla static because the functions are
actually unused, and the macro adds the unused attribute.

This silences -Wmissing-prototypes when defining.

Signed-off-by: Adeodato Simó <dato@....com.org.es>
---
I separated these two functions into a separate patch because they
are actually unused.

If you'd rather have them removed, we may do that as well.

Note that the ZSTD_STATIC macro adds the unused attribute in addition
to static, but it adds __inline as well.

 lib/zstd/compress.c     | 2 +-
 lib/zstd/fse_compress.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/zstd/compress.c b/lib/zstd/compress.c
index 3eee699e1fd6..c572d064775f 100644
--- a/lib/zstd/compress.c
+++ b/lib/zstd/compress.c
@@ -431,7 +431,7 @@ static void ZSTD_reduceIndex(ZSTD_CCtx *zc, const U32 reducerValue)
 
 /* See doc/zstd_compression_format.md for detailed format description */
 
-size_t ZSTD_noCompressBlock(void *dst, size_t dstCapacity, const void *src, size_t srcSize)
+ZSTD_STATIC size_t ZSTD_noCompressBlock(void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 {
 	if (srcSize + ZSTD_blockHeaderSize > dstCapacity)
 		return ERROR(dstSize_tooSmall);
diff --git a/lib/zstd/fse_compress.c b/lib/zstd/fse_compress.c
index ef3d1741d532..05a148eabd09 100644
--- a/lib/zstd/fse_compress.c
+++ b/lib/zstd/fse_compress.c
@@ -474,7 +474,7 @@ size_t FSE_count_wksp(unsigned *count, unsigned *maxSymbolValuePtr, const void *
 	`FSE_symbolCompressionTransform symbolTT[maxSymbolValue+1];`  // This size is variable
 Allocation is manual (C standard does not support variable-size structures).
 */
-size_t FSE_sizeof_CTable(unsigned maxSymbolValue, unsigned tableLog)
+ZSTD_STATIC size_t FSE_sizeof_CTable(unsigned maxSymbolValue, unsigned tableLog)
 {
 	if (tableLog > FSE_MAX_TABLELOG)
 		return ERROR(tableLog_tooLarge);
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ