mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 3/3] fs: ramfs: Drop unnecessary check in ramfs_mknod()
Date: Tue, 12 Mar 2019 00:21:50 -0700	[thread overview]
Message-ID: <20190312072150.19092-3-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20190312072150.19092-1-andrew.smirnov@gmail.com>

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>
---
 fs/ramfs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/ramfs.c b/fs/ramfs.c
index eec7cfb5b..7e7dc7aca 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;
 }
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2019-03-12  7:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12  7:21 [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode Andrey Smirnov
2019-03-12  7:21 ` [PATCH 2/3] fs: ramfs: Drop unused 'chunks' conter Andrey Smirnov
2019-03-12  7:21 ` Andrey Smirnov [this message]
2019-03-13  8:37 ` [PATCH 1/3] fs: ramfs: Drop unused 'handle' filed from struct ramfs_inode Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190312072150.19092-3-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox