From: Hui Su Date: Fri, 13 Nov 2020 13:21:43 +0000 (+0800) Subject: fs/kernfs: remove the double check of dentry->inode X-Git-Tag: accepted/tizen/unified/20230118.172025~8317^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0288e7fa35b37fc91c6afec8c420f71d0ade853f;p=platform%2Fkernel%2Flinux-rpi.git fs/kernfs: remove the double check of dentry->inode In both kernfs_node_from_dentry() and in kernfs_dentry_node(), we will check the dentry->inode is NULL or not, which is superfluous. So remove the check in kernfs_node_from_dentry(). Acked-by: Tejun Heo Signed-off-by: Hui Su Link: https://lore.kernel.org/r/20201113132143.GA119541@rlk Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index ea3c951..7a53eed 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -604,8 +604,7 @@ const struct dentry_operations kernfs_dops = { */ struct kernfs_node *kernfs_node_from_dentry(struct dentry *dentry) { - if (dentry->d_sb->s_op == &kernfs_sops && - !d_really_is_negative(dentry)) + if (dentry->d_sb->s_op == &kernfs_sops) return kernfs_dentry_node(dentry); return NULL; }