fs/hugetlbfs/inode.c: remove redundant -ENIVAL return from hugetlbfs_setattr()
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>
Thu, 16 Nov 2017 01:33:56 +0000 (17:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Nov 2017 02:21:03 +0000 (18:21 -0800)
There is no need to have a local return code set with -EINVAL when both
the conditions following it return error codes appropriately.  Just
remove the redundant one.

Link: http://lkml.kernel.org/r/20170929145444.17611-1-khandual@linux.vnet.ibm.com
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/hugetlbfs/inode.c

index ed113ea17affe6475523434d475aa2d94f6ce9c7..6adb17bb1a388f91af38ff30bfa62d57145b310e 100644 (file)
@@ -668,7 +668,6 @@ static int hugetlbfs_setattr(struct dentry *dentry, struct iattr *attr)
                return error;
 
        if (ia_valid & ATTR_SIZE) {
-               error = -EINVAL;
                if (attr->ia_size & ~huge_page_mask(h))
                        return -EINVAL;
                error = hugetlb_vmtruncate(inode, attr->ia_size);