linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Remove useless condition in if statement.
@ 2015-03-17  1:31 Wei Yuan
  2015-03-19 16:24 ` Lukáš Czerner
  2015-04-03  3:51 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yuan @ 2015-03-17  1:31 UTC (permalink / raw)
  To: tytso, adilger.kernel; +Cc: linux-ext4, linux-kernel

In this if statement, the previous condition is useless, the later one has covered it.

Signed-off-by: Weiyuan <weiyuan.wei@huawei.com>
---
 fs/ext4/xattr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 1e09fc7..f2ccad7 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -639,8 +639,7 @@ ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s)
 		free += EXT4_XATTR_LEN(name_len);
 	}
 	if (i->value) {
-		if (free < EXT4_XATTR_SIZE(i->value_len) ||
-		    free < EXT4_XATTR_LEN(name_len) +
+		if (free < EXT4_XATTR_LEN(name_len) +
 			   EXT4_XATTR_SIZE(i->value_len))
 			return -ENOSPC;
 	}
--
2.1.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: Remove useless condition in if statement.
  2015-03-17  1:31 [PATCH] ext4: Remove useless condition in if statement Wei Yuan
@ 2015-03-19 16:24 ` Lukáš Czerner
  2015-04-03  3:51 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Lukáš Czerner @ 2015-03-19 16:24 UTC (permalink / raw)
  To: Wei Yuan; +Cc: tytso, adilger.kernel, linux-ext4, linux-kernel

On Tue, 17 Mar 2015, Wei Yuan wrote:

> Date: Tue, 17 Mar 2015 09:31:54 +0800
> From: Wei Yuan <weiyuan.wei@huawei.com>
> To: tytso@mit.edu, adilger.kernel@dilger.ca
> Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
> Subject: [PATCH] ext4: Remove useless condition in if statement.
> 
> In this if statement, the previous condition is useless, the later one has covered it.

Looks good, thanks!

Reviewed-by: Lukas Czerner <lczerner@redhat.com>

> 
> Signed-off-by: Weiyuan <weiyuan.wei@huawei.com>
> ---
>  fs/ext4/xattr.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> index 1e09fc7..f2ccad7 100644
> --- a/fs/ext4/xattr.c
> +++ b/fs/ext4/xattr.c
> @@ -639,8 +639,7 @@ ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s)
>  		free += EXT4_XATTR_LEN(name_len);
>  	}
>  	if (i->value) {
> -		if (free < EXT4_XATTR_SIZE(i->value_len) ||
> -		    free < EXT4_XATTR_LEN(name_len) +
> +		if (free < EXT4_XATTR_LEN(name_len) +
>  			   EXT4_XATTR_SIZE(i->value_len))
>  			return -ENOSPC;
>  	}
> --
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: Remove useless condition in if statement.
  2015-03-17  1:31 [PATCH] ext4: Remove useless condition in if statement Wei Yuan
  2015-03-19 16:24 ` Lukáš Czerner
@ 2015-04-03  3:51 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2015-04-03  3:51 UTC (permalink / raw)
  To: Wei Yuan; +Cc: adilger.kernel, linux-ext4, linux-kernel

On Tue, Mar 17, 2015 at 09:31:54AM +0800, Wei Yuan wrote:
> In this if statement, the previous condition is useless, the later one has covered it.
> 
> Signed-off-by: Weiyuan <weiyuan.wei@huawei.com>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-03  3:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17  1:31 [PATCH] ext4: Remove useless condition in if statement Wei Yuan
2015-03-19 16:24 ` Lukáš Czerner
2015-04-03  3:51 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).