Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1204576 > unrolled thread

[patch] quota: remove an unneeded condition

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2015-08-10 23:40 +0200
Last post2015-08-11 10:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [patch] quota: remove an unneeded condition Dan Carpenter <dan.carpenter@oracle.com> - 2015-08-10 23:40 +0200
    Re: [patch] quota: remove an unneeded condition Jan Kara <jack@suse.cz> - 2015-08-11 10:10 +0200

#1204576 — [patch] quota: remove an unneeded condition

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-08-10 23:40 +0200
Subject[patch] quota: remove an unneeded condition
Message-ID<pW2Xv-1EC-13@gated-at.bofh.it>
We know "ret" is zero here so we can remove this condition.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 86ded73..3746367 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1204859

FromJan Kara <jack@suse.cz>
Date2015-08-11 10:10 +0200
Message-ID<pWcNb-7FX-5@gated-at.bofh.it>
In reply to#1204576
On Tue 11-08-15 00:29:55, Dan Carpenter wrote:
> We know "ret" is zero here so we can remove this condition.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

								Honza

> diff --git a/fs/quota/quota.c b/fs/quota/quota.c
> index 86ded73..3746367 100644
> --- a/fs/quota/quota.c
> +++ b/fs/quota/quota.c
> @@ -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)
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web