Skip to contentSkip to conversation

quota: remove an unneeded condition

PATCH In review Dan Carpenter 2 participants 2 messages Aug 10, 2015 – Aug 11, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 quota: remove an unneeded condition

We know "ret" is zero here so we can remove this condition.

fs/quota/quota.c +2 -2
index 86ded73..3746367 100644
@@ -141,9 +141,9 @@ static int quota_getinfo(struct super_block *sb, int type, void __user *addr)
 	if (tstate->flags & QCI_ROOT_SQUASH)
 		uinfo.dqi_flags |= DQF_ROOT_SQUASH;
 	uinfo.dqi_valid = IIF_ALL;
-	if (!ret && copy_to_user(addr, &uinfo, sizeof(uinfo)))
+	if (copy_to_user(addr, &uinfo, sizeof(uinfo)))
 		return -EFAULT;
-	return ret;
+	return 0;
 }
 
 static int quota_setinfo(struct super_block *sb, int type, void __user *addr)
#1 lore raw
Quoted 3 lines · Dan Carpenter

We know "ret" is zero here so we can remove this condition.

Thanks. I've added the patch to my tree.

Honza

Quoted 17 lines
fs/quota/quota.c +2 -2
index 86ded73..3746367 100644
@@ -141,9 +141,9 @@ static int quota_getinfo(struct super_block *sb, int type, void __user *addr)
 	if (tstate->flags & QCI_ROOT_SQUASH)
 		uinfo.dqi_flags |= DQF_ROOT_SQUASH;
 	uinfo.dqi_valid = IIF_ALL;
-	if (!ret && copy_to_user(addr, &uinfo, sizeof(uinfo)))
+	if (copy_to_user(addr, &uinfo, sizeof(uinfo)))
 		return -EFAULT;
-	return ret;
+	return 0;
 }
 
 static int quota_setinfo(struct super_block *sb, int type, void __user *addr)
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR