All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext2: Remove redundant check for finding no group
@ 2019-01-25 14:01 Liu Xiang
  2019-01-28 14:51 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Xiang @ 2019-01-25 14:01 UTC (permalink / raw)
  To: jack; +Cc: linux-ext4, linux-kernel, liuxiang_1999, Liu Xiang

When best_desc keeps NULL, best_group keeps -1, too. So we can
return best_group directly.

Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn>
---
 fs/ext2/ialloc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index 5c3d7b7..a0c5ea9 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -222,8 +222,6 @@ static int find_group_dir(struct super_block *sb, struct inode *parent)
 			best_desc = desc;
 		}
 	}
-	if (!best_desc)
-		return -1;
 
 	return best_group;
 }
-- 
1.9.1


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

* Re: [PATCH] ext2: Remove redundant check for finding no group
  2019-01-25 14:01 [PATCH] ext2: Remove redundant check for finding no group Liu Xiang
@ 2019-01-28 14:51 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2019-01-28 14:51 UTC (permalink / raw)
  To: Liu Xiang; +Cc: jack, linux-ext4, linux-kernel, liuxiang_1999

On Fri 25-01-19 22:01:36, Liu Xiang wrote:
> When best_desc keeps NULL, best_group keeps -1, too. So we can
> return best_group directly.
> 
> Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn>

Thanks for the patch! I've added it to my tree.

								Honza

> ---
>  fs/ext2/ialloc.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
> index 5c3d7b7..a0c5ea9 100644
> --- a/fs/ext2/ialloc.c
> +++ b/fs/ext2/ialloc.c
> @@ -222,8 +222,6 @@ static int find_group_dir(struct super_block *sb, struct inode *parent)
>  			best_desc = desc;
>  		}
>  	}
> -	if (!best_desc)
> -		return -1;
>  
>  	return best_group;
>  }
> -- 
> 1.9.1
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

end of thread, other threads:[~2019-01-28 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 14:01 [PATCH] ext2: Remove redundant check for finding no group Liu Xiang
2019-01-28 14:51 ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.