From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Liu Subject: [PATCH 2/2] vfs: remove unneeded error assignment in do_sys_ftruncate Date: Fri, 10 Jan 2014 21:38:50 +0800 Message-ID: <52CFF7EA.1090604@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "linux-fsdevel@vger.kernel.org" To: Al Viro Return-path: Received: from aserp1040.oracle.com ([141.146.126.69]:40449 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbaAJNi4 (ORCPT ); Fri, 10 Jan 2014 08:38:56 -0500 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Jie Liu Get rid of a redundant error re-assignment in do_sys_ftruncate(). Signed-off-by: Jie Liu --- 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