linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext3: Remove useless condition in if statement.
@ 2015-03-20  3:09 Wei Yuan
  2015-03-23 10:30 ` Lukáš Czerner
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yuan @ 2015-03-20  3:09 UTC (permalink / raw)
  To: jack, akpm, adilger.kernel; +Cc: linux-ext4, linux-kernel, lczerner, lizefan

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

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

diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index c6874be..24215dc 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -546,8 +546,7 @@ ext3_xattr_set_entry(struct ext3_xattr_info *i, struct ext3_xattr_search *s)
 		free += EXT3_XATTR_LEN(name_len);
 	}
 	if (i->value) {
-		if (free < EXT3_XATTR_SIZE(i->value_len) ||
-		    free < EXT3_XATTR_LEN(name_len) +
+		if (free < EXT3_XATTR_LEN(name_len) +
 			   EXT3_XATTR_SIZE(i->value_len))
 			return -ENOSPC;
 	}
-- 
2.1.0


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

* Re: [PATCH] ext3: Remove useless condition in if statement.
  2015-03-20  3:09 [PATCH] ext3: Remove useless condition in if statement Wei Yuan
@ 2015-03-23 10:30 ` Lukáš Czerner
  2015-04-01  7:40   ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Lukáš Czerner @ 2015-03-23 10:30 UTC (permalink / raw)
  To: Wei Yuan; +Cc: jack, akpm, adilger.kernel, linux-ext4, linux-kernel, lizefan

On Fri, 20 Mar 2015, Wei Yuan wrote:

> Date: Fri, 20 Mar 2015 11:09:10 +0800
> From: Wei Yuan <weiyuan.wei@huawei.com>
> To: jack@suse.cz, akpm@linux-foundation.org, adilger.kernel@dilger.ca
> Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
>     lczerner@redhat.com, lizefan@huawei.com
> Subject: [PATCH] ext3: Remove useless condition in if statement.
> 
> In this if statement, the previous condition is useless, the later one has covered it.

Nice that you've send this ext3 counterpart for ext4 patch. Thanks!

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

> 
> Signed-off-by: Weiyuan <weiyuan.wei@huawei.com>
> ---
>  fs/ext3/xattr.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
> index c6874be..24215dc 100644
> --- a/fs/ext3/xattr.c
> +++ b/fs/ext3/xattr.c
> @@ -546,8 +546,7 @@ ext3_xattr_set_entry(struct ext3_xattr_info *i, struct ext3_xattr_search *s)
>  		free += EXT3_XATTR_LEN(name_len);
>  	}
>  	if (i->value) {
> -		if (free < EXT3_XATTR_SIZE(i->value_len) ||
> -		    free < EXT3_XATTR_LEN(name_len) +
> +		if (free < EXT3_XATTR_LEN(name_len) +
>  			   EXT3_XATTR_SIZE(i->value_len))
>  			return -ENOSPC;
>  	}
> 

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

* Re: [PATCH] ext3: Remove useless condition in if statement.
  2015-03-23 10:30 ` Lukáš Czerner
@ 2015-04-01  7:40   ` Jan Kara
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2015-04-01  7:40 UTC (permalink / raw)
  To: Lukáš Czerner
  Cc: Wei Yuan, jack, akpm, adilger.kernel, linux-ext4, linux-kernel, lizefan

On Mon 23-03-15 11:30:44, Lukáš Czerner wrote:
> On Fri, 20 Mar 2015, Wei Yuan wrote:
> 
> > Date: Fri, 20 Mar 2015 11:09:10 +0800
> > From: Wei Yuan <weiyuan.wei@huawei.com>
> > To: jack@suse.cz, akpm@linux-foundation.org, adilger.kernel@dilger.ca
> > Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
> >     lczerner@redhat.com, lizefan@huawei.com
> > Subject: [PATCH] ext3: Remove useless condition in if statement.
> > 
> > In this if statement, the previous condition is useless, the later one has covered it.
> 
> Nice that you've send this ext3 counterpart for ext4 patch. Thanks!
> 
> Reviewed-by: Lukas Czerner <lczerner@redhat.com>
  Thanks. I've added the patch to my tree.

								Honza

> 
> > 
> > Signed-off-by: Weiyuan <weiyuan.wei@huawei.com>
> > ---
> >  fs/ext3/xattr.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
> > index c6874be..24215dc 100644
> > --- a/fs/ext3/xattr.c
> > +++ b/fs/ext3/xattr.c
> > @@ -546,8 +546,7 @@ ext3_xattr_set_entry(struct ext3_xattr_info *i, struct ext3_xattr_search *s)
> >  		free += EXT3_XATTR_LEN(name_len);
> >  	}
> >  	if (i->value) {
> > -		if (free < EXT3_XATTR_SIZE(i->value_len) ||
> > -		    free < EXT3_XATTR_LEN(name_len) +
> > +		if (free < EXT3_XATTR_LEN(name_len) +
> >  			   EXT3_XATTR_SIZE(i->value_len))
> >  			return -ENOSPC;
> >  	}
> > 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

end of thread, other threads:[~2015-04-01  7:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20  3:09 [PATCH] ext3: Remove useless condition in if statement Wei Yuan
2015-03-23 10:30 ` Lukáš Czerner
2015-04-01  7:40   ` Jan Kara

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).