All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ocfs2: remove redundant assignment to variable free_space
@ 2022-01-12 23:04 Colin Ian King
  2022-01-13  2:18   ` [Ocfs2-devel] " Joseph Qi via Ocfs2-devel
  0 siblings, 1 reply; 3+ messages in thread
From: Colin Ian King @ 2022-01-12 23:04 UTC (permalink / raw)
  To: Mark Fasheh, Joel Becker, Joseph Qi, ocfs2-devel
  Cc: kernel-janitors, linux-kernel

Variable free_space is being initialized with a value that is not read,
it is being re-assigned later in the two paths of an if statement. The
early initialization is redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/ocfs2/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index bd8d534f11cb..f2cc1ff29e6d 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -3343,7 +3343,7 @@ static int ocfs2_find_dir_space_id(struct inode *dir, struct buffer_head *di_bh,
 	struct ocfs2_dir_entry *de, *last_de = NULL;
 	char *de_buf, *limit;
 	unsigned long offset = 0;
-	unsigned int rec_len, new_rec_len, free_space = dir->i_sb->s_blocksize;
+	unsigned int rec_len, new_rec_len, free_space;
 
 	/*
 	 * This calculates how many free bytes we'd have in block zero, should
-- 
2.33.1


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

* Re: [PATCH] ocfs2: remove redundant assignment to variable free_space
  2022-01-12 23:04 [PATCH] ocfs2: remove redundant assignment to variable free_space Colin Ian King
@ 2022-01-13  2:18   ` Joseph Qi via Ocfs2-devel
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph Qi @ 2022-01-13  2:18 UTC (permalink / raw)
  To: Colin Ian King, Mark Fasheh, Joel Becker, ocfs2-devel, akpm
  Cc: kernel-janitors, linux-kernel



On 1/13/22 7:04 AM, Colin Ian King wrote:
> Variable free_space is being initialized with a value that is not read,
> it is being re-assigned later in the two paths of an if statement. The
> early initialization is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/dir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
> index bd8d534f11cb..f2cc1ff29e6d 100644
> --- a/fs/ocfs2/dir.c
> +++ b/fs/ocfs2/dir.c
> @@ -3343,7 +3343,7 @@ static int ocfs2_find_dir_space_id(struct inode *dir, struct buffer_head *di_bh,
>  	struct ocfs2_dir_entry *de, *last_de = NULL;
>  	char *de_buf, *limit;
>  	unsigned long offset = 0;
> -	unsigned int rec_len, new_rec_len, free_space = dir->i_sb->s_blocksize;
> +	unsigned int rec_len, new_rec_len, free_space;
>  
>  	/*
>  	 * This calculates how many free bytes we'd have in block zero, should

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

* Re: [Ocfs2-devel] [PATCH] ocfs2: remove redundant assignment to variable free_space
@ 2022-01-13  2:18   ` Joseph Qi via Ocfs2-devel
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph Qi via Ocfs2-devel @ 2022-01-13  2:18 UTC (permalink / raw)
  To: Colin Ian King, Mark Fasheh, Joel Becker, ocfs2-devel, akpm
  Cc: kernel-janitors, linux-kernel



On 1/13/22 7:04 AM, Colin Ian King wrote:
> Variable free_space is being initialized with a value that is not read,
> it is being re-assigned later in the two paths of an if statement. The
> early initialization is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/dir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
> index bd8d534f11cb..f2cc1ff29e6d 100644
> --- a/fs/ocfs2/dir.c
> +++ b/fs/ocfs2/dir.c
> @@ -3343,7 +3343,7 @@ static int ocfs2_find_dir_space_id(struct inode *dir, struct buffer_head *di_bh,
>  	struct ocfs2_dir_entry *de, *last_de = NULL;
>  	char *de_buf, *limit;
>  	unsigned long offset = 0;
> -	unsigned int rec_len, new_rec_len, free_space = dir->i_sb->s_blocksize;
> +	unsigned int rec_len, new_rec_len, free_space;
>  
>  	/*
>  	 * This calculates how many free bytes we'd have in block zero, should

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

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

end of thread, other threads:[~2022-01-13  2:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 23:04 [PATCH] ocfs2: remove redundant assignment to variable free_space Colin Ian King
2022-01-13  2:18 ` Joseph Qi
2022-01-13  2:18   ` [Ocfs2-devel] " Joseph Qi via Ocfs2-devel

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.