From: Nick Terrell <terrelln@fb.com>
To: Nikolay Borisov <nborisov@suse.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v3 13/14] lib/zstd: Convert constants to defines
Date: Sat, 23 Jan 2021 17:50:52 +0000 [thread overview]
Message-ID: <8849FEEB-48EC-4C63-9046-279C9AFF029D@fb.com> (raw)
In-Reply-To: <20210122095805.620458-14-nborisov@suse.com>
> On Jan 22, 2021, at 1:58 AM, Nikolay Borisov <nborisov@suse.com> wrote:
>
> Those constants are really used internally by zstd and including
> linux/zstd.h into users results in the following warnings:
>
> In file included from fs/btrfs/zstd.c:19:
> ./include/linux/zstd.h:798:21: warning: ‘ZSTD_skippableHeaderSize’ defined but not used [-Wunused-const-variable=]
> 798 | static const size_t ZSTD_skippableHeaderSize = 8;
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/zstd.h:796:21: warning: ‘ZSTD_frameHeaderSize_max’ defined but not used [-Wunused-const-variable=]
> 796 | static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/zstd.h:795:21: warning: ‘ZSTD_frameHeaderSize_min’ defined but not used [-Wunused-const-variable=]
> 795 | static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN;
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/zstd.h:794:21: warning: ‘ZSTD_frameHeaderSize_prefix’ defined but not used [-Wunused-const-variable=]
> 794 | static const size_t ZSTD_frameHeaderSize_prefix = 5;
>
> So fix those warnings by turning the constants into defines.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> include/linux/zstd.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/zstd.h b/include/linux/zstd.h
> index 249575e2485f..e87f78c9b19c 100644
> --- a/include/linux/zstd.h
> +++ b/include/linux/zstd.h
> @@ -791,11 +791,11 @@ size_t ZSTD_DStreamOutSize(void);
> /* for static allocation */
> #define ZSTD_FRAMEHEADERSIZE_MAX 18
> #define ZSTD_FRAMEHEADERSIZE_MIN 6
> -static const size_t ZSTD_frameHeaderSize_prefix = 5;
> -static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN;
> -static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
> +#define ZSTD_frameHeaderSize_prefix 5
> +#define ZSTD_frameHeaderSize_min ZSTD_FRAMEHEADERSIZE_MIN
> +#define ZSTD_frameHeaderSize_max ZSTD_FRAMEHEADERSIZE_MAX
> /* magic number + skippable frame length */
> -static const size_t ZSTD_skippableHeaderSize = 8;
> +#define ZSTD_skippableHeaderSize 8
>
>
> /*-*************************************
This looks good to me! We removed these constants from the upstream header a
while ago, for similar reasons.
You can add:
Reviewed-by: Nick Terrell <terrelln@fb.com>
-Nick
next prev parent reply other threads:[~2021-01-23 17:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-22 9:57 [PATCH v3 00/14] Make btrfs W=1 clean Nikolay Borisov
2021-01-22 9:57 ` [PATCH v3 01/14] btrfs: Document modified parameter of add_extent_mapping Nikolay Borisov
2021-01-22 12:32 ` Johannes Thumshirn
2021-01-22 9:57 ` [PATCH v3 02/14] btrfs: Fix parameter description of btrfs_add_extent_mapping Nikolay Borisov
2021-01-22 12:35 ` Johannes Thumshirn
2021-01-22 9:57 ` [PATCH v3 03/14] btrfs: Fix function description format Nikolay Borisov
2021-01-22 12:38 ` Johannes Thumshirn
2021-01-22 9:57 ` [PATCH v3 04/14] btrfs: Fix parameter description in delayed-ref.c functions Nikolay Borisov
2021-01-22 13:52 ` Johannes Thumshirn
2021-01-22 9:57 ` [PATCH v3 05/14] btrfs: Improve parameter description for __btrfs_write_out_cache Nikolay Borisov
2021-01-22 9:57 ` [PATCH v3 06/14] btrfs: Document now parameter of peek_discard_list Nikolay Borisov
2021-01-22 9:57 ` [PATCH v3 07/14] btrfs: Document fs_info in btrfs_rmap_block Nikolay Borisov
2021-01-22 9:57 ` [PATCH v3 08/14] btrfs: Fix description format of fs_info parameter of btrfs_wait_on_delayed_iputs Nikolay Borisov
2021-01-22 9:58 ` [PATCH v3 09/14] btrfs: Document btrfs_check_shared parameters Nikolay Borisov
2021-01-22 9:58 ` [PATCH v3 10/14] btrfs: Fix parameter description of btrfs_inode_rsv_release/btrfs_delalloc_release_space Nikolay Borisov
2021-01-22 9:58 ` [PATCH v3 11/14] btrfs: Fix parameter description in space-info.c Nikolay Borisov
2021-01-22 9:58 ` [PATCH v3 12/14] btrfs: Fix parameter description for functions in extent_io.c Nikolay Borisov
2021-01-22 9:58 ` [PATCH v3 13/14] lib/zstd: Convert constants to defines Nikolay Borisov
2021-01-22 10:26 ` Nikolay Borisov
2021-01-23 17:50 ` Nick Terrell [this message]
2021-01-24 11:16 ` David Sterba
2021-01-22 9:58 ` [PATCH v3 14/14] btrfs: Enable W=1 checks for btrfs Nikolay Borisov
2021-01-22 16:35 ` David Sterba
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=8849FEEB-48EC-4C63-9046-279C9AFF029D@fb.com \
--to=terrelln@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.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