diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-03-12 00:21:50 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-03-13 09:37:03 +0100 |
commit | a54a87cfe15b5c3b7c61ea1cc7089050a9e7c63a (patch) | |
tree | ee105164284823d21c956ac0cab643a6a97fc97f /fs | |
parent | 956db2799fac56ca73b60f27675b42dcf7907275 (diff) | |
download | barebox-a54a87cfe15b5c3b7c61ea1cc7089050a9e7c63a.tar.gz barebox-a54a87cfe15b5c3b7c61ea1cc7089050a9e7c63a.tar.xz |
fs: ramfs: Drop unnecessary check in ramfs_mknod()
There's already an early exit statement triggered by "inode" being
NULL. Drop an extra check that will always be true.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ramfs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ramfs.c b/fs/ramfs.c index eec7cfb5b7..7e7dc7aca9 100644 --- a/fs/ramfs.c +++ b/fs/ramfs.c @@ -131,10 +131,8 @@ ramfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode) if (!inode) return -ENOSPC; - if (inode) { - d_instantiate(dentry, inode); - dget(dentry); /* Extra count - pin the dentry in core */ - } + d_instantiate(dentry, inode); + dget(dentry); /* Extra count - pin the dentry in core */ return 0; } |