From: Chuck Lever III <chuck.lever@oracle.com>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NFSD: Remove redundant assignment to variable host_err
Date: Tue, 11 Oct 2022 14:06:47 +0000 [thread overview]
Message-ID: <ECDFC360-1397-4C3E-AAC6-7FE532E8167C@oracle.com> (raw)
In-Reply-To: <20221010202423.3221664-1-colin.i.king@gmail.com>
> On Oct 10, 2022, at 4:24 PM, Colin Ian King <colin.i.king@gmail.com> wrote:
>
> Variable host_err is assigned a value that is never read, it is being
> re-assigned a value in every different execution path in the following
> switch statement. The assignment is redundant and can be removed.
>
> Cleans up clang-scan warning:
> warning: Value stored to 'host_err' is never read [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Applying this for nfsd's for-next (not yet public). Thanks!
> ---
> fs/nfsd/vfs.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> index f650afedd67f..5093ae788f53 100644
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -1304,7 +1304,6 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
> iap->ia_mode &= ~current_umask();
>
> err = 0;
> - host_err = 0;
> switch (type) {
> case S_IFREG:
> host_err = vfs_create(&init_user_ns, dirp, dchild, iap->ia_mode, true);
> --
> 2.37.3
>
--
Chuck Lever
prev parent reply other threads:[~2022-10-11 14:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-10 20:24 Colin Ian King
2022-10-10 23:15 ` Jeff Layton
2022-10-11 14:06 ` Chuck Lever III [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=ECDFC360-1397-4C3E-AAC6-7FE532E8167C@oracle.com \
--to=chuck.lever@oracle.com \
--cc=colin.i.king@gmail.com \
--cc=jlayton@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
/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®