[PATCH] kernfs: mount: Remove unnecessary ‘NULL’ values from knparent

Li zeming posted 1 patch 1 year, 10 months ago
fs/kernfs/mount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] kernfs: mount: Remove unnecessary ‘NULL’ values from knparent
Posted by Li zeming 1 year, 10 months ago
knparent is assigned first, so it does not need to initialize the
assignment.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 fs/kernfs/mount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c
index 0c93cad0f0aca..d38bc7aeb598c 100644
--- a/fs/kernfs/mount.c
+++ b/fs/kernfs/mount.c
@@ -206,7 +206,7 @@ struct dentry *kernfs_node_dentry(struct kernfs_node *kn,
 				  struct super_block *sb)
 {
 	struct dentry *dentry;
-	struct kernfs_node *knparent = NULL;
+	struct kernfs_node *knparent;
 
 	BUG_ON(sb->s_op != &kernfs_sops);
 
-- 
2.18.2
Re: [PATCH] kernfs: mount: Remove unnecessary ‘NULL’ values from knparent
Posted by Tejun Heo 1 year, 9 months ago
On Mon, Apr 15, 2024 at 06:20:09PM +0800, Li zeming wrote:
> knparent is assigned first, so it does not need to initialize the
> assignment.
> 
> Signed-off-by: Li zeming <zeming@nfschina.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun