linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] vfs: remove unneeded error assignment in do_sys_ftruncate
@ 2014-01-10 13:38 Jeff Liu
  0 siblings, 0 replies; only message in thread
From: Jeff Liu @ 2014-01-10 13:38 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel@vger.kernel.org

From: Jie Liu <jeff.liu@oracle.com>

Get rid of a redundant error re-assignment in do_sys_ftruncate().

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 fs/open.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index 327cfb1..815e2e2 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -154,9 +154,8 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
 	struct inode *inode;
 	struct dentry *dentry;
 	struct fd f;
-	int error;
+	int error = -EINVAL;
 
-	error = -EINVAL;
 	if (length < 0)
 		goto out;
 	error = -EBADF;
@@ -174,7 +173,6 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
 	if (!S_ISREG(inode->i_mode) || !(f.file->f_mode & FMODE_WRITE))
 		goto out_putf;
 
-	error = -EINVAL;
 	/* Cannot ftruncate over 2^31 bytes without large file support */
 	if (small && length > MAX_NON_LFS)
 		goto out_putf;
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-10 13:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-10 13:38 [PATCH 2/2] vfs: remove unneeded error assignment in do_sys_ftruncate Jeff Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).