* [PATCH][next] nfsd: remove redundant assignment to pointer dentry
@ 2023-02-14 14:14 Colin Ian King
2023-02-14 14:55 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Colin Ian King @ 2023-02-14 14:14 UTC (permalink / raw)
To: Chuck Lever, Jeff Layton, linux-nfs; +Cc: kernel-janitors, linux-kernel
The pointer dentry is assigned a value that is never read, the
assignment is redundant and can be removed.
Cleans up clang-scan warning:
fs/nfsd/nfsctl.c:1231:2: warning: Value stored to 'dentry' is
never read [deadcode.DeadStores]
dentry = ERR_PTR(ret);
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 04474b8ccf0a..5946064cd794 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1228,7 +1228,6 @@ static void nfsd_symlink(struct dentry *parent, const char *name,
return;
out_err:
dput(dentry);
- dentry = ERR_PTR(ret);
goto out;
}
#else
--
2.30.2
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH][next] nfsd: remove redundant assignment to pointer dentry
2023-02-14 14:14 [PATCH][next] nfsd: remove redundant assignment to pointer dentry Colin Ian King
@ 2023-02-14 14:55 ` Dan Carpenter
2023-02-14 15:16 ` Chuck Lever III
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2023-02-14 14:55 UTC (permalink / raw)
To: Colin Ian King
Cc: Chuck Lever, Jeff Layton, linux-nfs, kernel-janitors, linux-kernel
On Tue, Feb 14, 2023 at 02:14:28PM +0000, Colin Ian King wrote:
> The pointer dentry is assigned a value that is never read, the
> assignment is redundant and can be removed.
>
> Cleans up clang-scan warning:
> fs/nfsd/nfsctl.c:1231:2: warning: Value stored to 'dentry' is
> never read [deadcode.DeadStores]
> dentry = ERR_PTR(ret);
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
No need to initalized "int ret = -ENOMEM;" either.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] nfsd: remove redundant assignment to pointer dentry
2023-02-14 14:55 ` Dan Carpenter
@ 2023-02-14 15:16 ` Chuck Lever III
0 siblings, 0 replies; 3+ messages in thread
From: Chuck Lever III @ 2023-02-14 15:16 UTC (permalink / raw)
To: Dan Carpenter, Colin Ian King
Cc: Jeff Layton, Linux NFS Mailing List, kernel-janitors,
Linux Kernel Mailing List
> On Feb 14, 2023, at 9:55 AM, Dan Carpenter <error27@gmail.com> wrote:
>
> On Tue, Feb 14, 2023 at 02:14:28PM +0000, Colin Ian King wrote:
>> The pointer dentry is assigned a value that is never read, the
>> assignment is redundant and can be removed.
>>
>> Cleans up clang-scan warning:
>> fs/nfsd/nfsctl.c:1231:2: warning: Value stored to 'dentry' is
>> never read [deadcode.DeadStores]
>> dentry = ERR_PTR(ret);
>>
>> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>
> No need to initalized "int ret = -ENOMEM;" either.
Thanks for the report.
Both came in when I copied nfsd_mkdir. I'll clean them up.
--
Chuck Lever
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-14 15:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14 14:14 [PATCH][next] nfsd: remove redundant assignment to pointer dentry Colin Ian King
2023-02-14 14:55 ` Dan Carpenter
2023-02-14 15:16 ` Chuck Lever III
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®