From: "Adeodato Simó" <dato@net.com.org.es>
To: Nick Terrell <terrelln@fb.com>
Cc: Chris Mason <clm@fb.com>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] lib/zstd: mark some internal functions as static with ZSTD_STATIC
Date: Wed, 14 Nov 2018 21:27:19 -0300 [thread overview]
Message-ID: <7e1778db6a6f586f3c7662c4878a349fde92084d.1542240915.git.dato@net.com.org.es> (raw)
In-Reply-To: <0ba48478013532f20856dca7d90c343d93901d54.1542240915.git.dato@net.com.org.es>
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@net.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
prev parent reply other threads:[~2018-11-15 0:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-15 0:27 [PATCH 1/2] lib/zstd: mark several internal functions as static Adeodato Simó
2018-11-15 0:27 ` Adeodato Simó [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e1778db6a6f586f3c7662c4878a349fde92084d.1542240915.git.dato@net.com.org.es \
--to=dato@net.com.org.es \
--cc=clm@fb.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=terrelln@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).