From: Jeff Liu <jeff.liu@oracle.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: [PATCH 2/2] vfs: remove unneeded error assignment in do_sys_ftruncate
Date: Fri, 10 Jan 2014 21:38:50 +0800 [thread overview]
Message-ID: <52CFF7EA.1090604@oracle.com> (raw)
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
reply other threads:[~2014-01-10 13:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=52CFF7EA.1090604@oracle.com \
--to=jeff.liu@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).