From: Christian Brauner <brauner@kernel.org>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] fs/buffer: Remove redundant assignment to err
Date: Wed, 22 Mar 2023 09:20:43 +0100 [thread overview]
Message-ID: <20230322082043.f3vcu4iucqe533hl@wittgenstein> (raw)
In-Reply-To: <20230322065949.29223-1-jiapeng.chong@linux.alibaba.com>
On Wed, Mar 22, 2023 at 02:59:49PM +0800, Jiapeng Chong wrote:
> Variable 'err' set but not used.
>
> fs/buffer.c:2613:2: warning: Value stored to 'err' is never read.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4589
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
> fs/buffer.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/fs/buffer.c b/fs/buffer.c
> index d759b105c1e7..c844b5b93a89 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -2580,7 +2580,7 @@ int block_truncate_page(struct address_space *mapping,
> struct inode *inode = mapping->host;
> struct page *page;
> struct buffer_head *bh;
> - int err;
> + int err = 0;
>
> blocksize = i_blocksize(inode);
> length = offset & (blocksize - 1);
> @@ -2593,9 +2593,8 @@ int block_truncate_page(struct address_space *mapping,
> iblock = (sector_t)index << (PAGE_SHIFT - inode->i_blkbits);
>
> page = grab_cache_page(mapping, index);
> - err = -ENOMEM;
> if (!page)
> - goto out;
> + return -ENOMEM;
This change makes the out: label unused.
next prev parent reply other threads:[~2023-03-22 8:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 6:59 Jiapeng Chong
2023-03-22 8:20 ` Christian Brauner [this message]
2023-03-22 11:07 ` kernel test robot
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=20230322082043.f3vcu4iucqe533hl@wittgenstein \
--to=brauner@kernel.org \
--cc=abaci@linux.alibaba.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®