2020-04-02 06:19:48

by Jason Yan

[permalink] [raw]
Subject: [PATCH -next] f2fs: remove set but not used variable 'params'

Fix the following gcc warning:

fs/f2fs/compress.c:375:18: warning: variable 'params' set but not used [-Wunused-but-set-variable]
ZSTD_parameters params;
^~~~~~

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Jason Yan <[email protected]>
---
fs/f2fs/compress.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index f05ecf4cb899..df7b2d15eacd 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -372,12 +372,10 @@ static int zstd_compress_pages(struct compress_ctx *cc)

static int zstd_init_decompress_ctx(struct decompress_io_ctx *dic)
{
- ZSTD_parameters params;
ZSTD_DStream *stream;
void *workspace;
unsigned int workspace_size;

- params = ZSTD_getParams(F2FS_ZSTD_DEFAULT_CLEVEL, dic->clen, 0);
workspace_size = ZSTD_DStreamWorkspaceBound(MAX_COMPRESS_WINDOW_SIZE);

workspace = f2fs_kvmalloc(F2FS_I_SB(dic->inode),
--
2.17.2


2020-04-02 08:39:51

by Chao Yu

[permalink] [raw]
Subject: Re: [f2fs-dev] [PATCH -next] f2fs: remove set but not used variable 'params'

Hi Jason,

On 2020/4/2 14:15, Jason Yan wrote:
> Fix the following gcc warning:
>
> fs/f2fs/compress.c:375:18: warning: variable 'params' set but not used [-Wunused-but-set-variable]
> ZSTD_parameters params;
> ^~~~~~
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Jason Yan <[email protected]>

Thanks for the patch, would you mind that just merge this fix into
original path which is still in f2fs private git tree?

Thanks,

> ---
> fs/f2fs/compress.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
> index f05ecf4cb899..df7b2d15eacd 100644
> --- a/fs/f2fs/compress.c
> +++ b/fs/f2fs/compress.c
> @@ -372,12 +372,10 @@ static int zstd_compress_pages(struct compress_ctx *cc)
>
> static int zstd_init_decompress_ctx(struct decompress_io_ctx *dic)
> {
> - ZSTD_parameters params;
> ZSTD_DStream *stream;
> void *workspace;
> unsigned int workspace_size;
>
> - params = ZSTD_getParams(F2FS_ZSTD_DEFAULT_CLEVEL, dic->clen, 0);
> workspace_size = ZSTD_DStreamWorkspaceBound(MAX_COMPRESS_WINDOW_SIZE);
>
> workspace = f2fs_kvmalloc(F2FS_I_SB(dic->inode),
>

2020-04-02 09:20:37

by Jason Yan

[permalink] [raw]
Subject: Re: [f2fs-dev] [PATCH -next] f2fs: remove set but not used variable 'params'

Hi Chao,

在 2020/4/2 16:37, Chao Yu 写道:
> Hi Jason,
>
> On 2020/4/2 14:15, Jason Yan wrote:
>> Fix the following gcc warning:
>>
>> fs/f2fs/compress.c:375:18: warning: variable 'params' set but not used [-Wunused-but-set-variable]
>> ZSTD_parameters params;
>> ^~~~~~
>>
>> Reported-by: Hulk Robot <[email protected]>
>> Signed-off-by: Jason Yan <[email protected]>
>
> Thanks for the patch, would you mind that just merge this fix into
> original path which is still in f2fs private git tree?
>

It's ok to merge this into the original patch.

> Thanks,
>
>> ---
>> fs/f2fs/compress.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
>> index f05ecf4cb899..df7b2d15eacd 100644
>> --- a/fs/f2fs/compress.c
>> +++ b/fs/f2fs/compress.c
>> @@ -372,12 +372,10 @@ static int zstd_compress_pages(struct compress_ctx *cc)
>>
>> static int zstd_init_decompress_ctx(struct decompress_io_ctx *dic)
>> {
>> - ZSTD_parameters params;
>> ZSTD_DStream *stream;
>> void *workspace;
>> unsigned int workspace_size;
>>
>> - params = ZSTD_getParams(F2FS_ZSTD_DEFAULT_CLEVEL, dic->clen, 0);
>> workspace_size = ZSTD_DStreamWorkspaceBound(MAX_COMPRESS_WINDOW_SIZE);
>>
>> workspace = f2fs_kvmalloc(F2FS_I_SB(dic->inode),
>>
>
> .
>