linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/buffer.c: remove unneeded code
@ 2022-04-02  8:47 cgel.zte
  2022-04-02 21:41 ` Chaitanya Kulkarni
  2022-04-04 17:16 ` Nick Desaulniers
  0 siblings, 2 replies; 3+ messages in thread
From: cgel.zte @ 2022-04-02  8:47 UTC (permalink / raw)
  To: viro
  Cc: nathan, ndesaulniers, linux-fsdevel, linux-kernel, llvm, Lv Ruyi,
	Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

fix clang warning: Value stored to 'err' is never read in line 2944.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 fs/buffer.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index bfc566de36e5..b2045871e81c 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2941,7 +2941,6 @@ int block_truncate_page(struct address_space *mapping,
 		pos += blocksize;
 	}
 
-	err = 0;
 	if (!buffer_mapped(bh)) {
 		WARN_ON(bh->b_size != blocksize);
 		err = get_block(inode, iblock, bh, 0);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs/buffer.c: remove unneeded code
  2022-04-02  8:47 [PATCH] fs/buffer.c: remove unneeded code cgel.zte
@ 2022-04-02 21:41 ` Chaitanya Kulkarni
  2022-04-04 17:16 ` Nick Desaulniers
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2022-04-02 21:41 UTC (permalink / raw)
  To: cgel.zte, viro
  Cc: nathan, ndesaulniers, linux-fsdevel, linux-kernel, llvm, Lv Ruyi,
	Zeal Robot

On 4/2/22 01:47, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> fix clang warning: Value stored to 'err' is never read in line 2944.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>


Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs/buffer.c: remove unneeded code
  2022-04-02  8:47 [PATCH] fs/buffer.c: remove unneeded code cgel.zte
  2022-04-02 21:41 ` Chaitanya Kulkarni
@ 2022-04-04 17:16 ` Nick Desaulniers
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2022-04-04 17:16 UTC (permalink / raw)
  To: cgel.zte
  Cc: viro, nathan, linux-fsdevel, linux-kernel, llvm, Lv Ruyi, Zeal Robot

On Sat, Apr 2, 2022 at 1:47 AM <cgel.zte@gmail.com> wrote:
>
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> fix clang warning: Value stored to 'err' is never read in line 2944.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

The change LGTM, but next time please consider putting the exact text
of the warning observed in the commit message.  For instance, it's not
clear to me whether this was a compiler warning via -W flag, or a
DeadStore warning from clang-tidy.

Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  fs/buffer.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/fs/buffer.c b/fs/buffer.c
> index bfc566de36e5..b2045871e81c 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -2941,7 +2941,6 @@ int block_truncate_page(struct address_space *mapping,
>                 pos += blocksize;
>         }
>
> -       err = 0;
>         if (!buffer_mapped(bh)) {
>                 WARN_ON(bh->b_size != blocksize);
>                 err = get_block(inode, iblock, bh, 0);
> --
> 2.25.1
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-04 21:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-02  8:47 [PATCH] fs/buffer.c: remove unneeded code cgel.zte
2022-04-02 21:41 ` Chaitanya Kulkarni
2022-04-04 17:16 ` Nick Desaulniers

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).