Skip to contentSkip to conversation

vfs: remove unneeded error assignment in do_sys_ftruncate

PATCH New Jeff Liu 1 participant 1 message Jan 10, 2014 VFS

lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH 2/2 vfs: remove unneeded error assignment in do_sys_ftruncate

From: Jie Liu <[email protected]>

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

---
 fs/open.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/open.c +1 -3
index 327cfb1..815e2e2 100644
@@ -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;
Signature · 1 line
1.8.3.2