* [PATCH] nfsd: remove redundant assignment to variable len
@ 2022-06-28 21:25 Colin Ian King
2022-06-28 22:14 ` Chuck Lever III
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-06-28 21:25 UTC (permalink / raw)
To: Chuck Lever, Jeff Layton, linux-nfs; +Cc: kernel-janitors, linux-kernel
Variable len is being assigned a value zero and this is never
read, it is being re-assigned later. The assignment is redundant
and can be removed.
Cleans up clang scan-build warning:
fs/nfsd/nfsctl.c:636:2: warning: Value stored to 'len' is never read
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
fs/nfsd/nfsctl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 0621c2faf242..66c352bf61b1 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -633,7 +633,6 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
}
/* Now write current state into reply buffer */
- len = 0;
sep = "";
remaining = SIMPLE_TRANSACTION_LIMIT;
for (num=2 ; num <= 4 ; num++) {
--
2.35.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nfsd: remove redundant assignment to variable len
2022-06-28 21:25 [PATCH] nfsd: remove redundant assignment to variable len Colin Ian King
@ 2022-06-28 22:14 ` Chuck Lever III
0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever III @ 2022-06-28 22:14 UTC (permalink / raw)
To: Colin Ian King
Cc: Jeff Layton, Linux NFS Mailing List, kernel-janitors, linux-kernel
> On Jun 28, 2022, at 5:25 PM, Colin Ian King <colin.i.king@gmail.com> wrote:
>
> Variable len is being assigned a value zero and this is never
> read, it is being re-assigned later. The assignment is redundant
> and can be removed.
>
> Cleans up clang scan-build warning:
> fs/nfsd/nfsctl.c:636:2: warning: Value stored to 'len' is never read
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Thanks, applied to the NFSD for-next branch.
> ---
> fs/nfsd/nfsctl.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> index 0621c2faf242..66c352bf61b1 100644
> --- a/fs/nfsd/nfsctl.c
> +++ b/fs/nfsd/nfsctl.c
> @@ -633,7 +633,6 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
> }
>
> /* Now write current state into reply buffer */
> - len = 0;
> sep = "";
> remaining = SIMPLE_TRANSACTION_LIMIT;
> for (num=2 ; num <= 4 ; num++) {
> --
> 2.35.3
>
--
Chuck Lever
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-28 22:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 21:25 [PATCH] nfsd: remove redundant assignment to variable len Colin Ian King
2022-06-28 22:14 ` Chuck Lever III
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.