* [patch] quota: remove an unneeded condition
@ 2015-08-10 21:29 Dan Carpenter
2015-08-11 8:03 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-08-10 21:29 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-kernel, kernel-janitors
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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] quota: remove an unneeded condition
2015-08-10 21:29 [patch] quota: remove an unneeded condition Dan Carpenter
@ 2015-08-11 8:03 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2015-08-11 8:03 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Jan Kara, linux-kernel, kernel-janitors
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-11 8:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-10 21:29 [patch] quota: remove an unneeded condition Dan Carpenter
2015-08-11 8:03 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox