Skip to contentSkip to conversation

fs/hugetlbfs/inode.c: remove redundant -ENIVAL return from hugetlbfs_setattr()

PATCH New [email protected] 1 participant 1 message Nov 16, 2017 HugeTLB

lore
Share & tools
lore
#0 lore raw

PATCH 44/131 fs/hugetlbfs/inode.c: remove redundant -ENIVAL return from hugetlbfs_setattr()

From: Anshuman Khandual <[email protected]>
Subject: fs/hugetlbfs/inode.c: remove redundant -ENIVAL return from hugetlbfs_setattr()

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.

---

 fs/hugetlbfs/inode.c |    1 -
 1 file changed, 1 deletion(-)
fs/hugetlbfs/inode.c renamed from fs/hugetlbfs/inode.c~mm-hugetlbfs-remove-the-redundant-enival-return-from-hugetlbfs_setattr +0 -1
diff -puN fs/hugetlbfs/inode.c~mm-hugetlbfs-remove-the-redundant-enival-return-from-hugetlbfs_setattr fs/hugetlbfs/inode.c
@@ -668,7 +668,6 @@ static int hugetlbfs_setattr(struct dent
 		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);

_