linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] fs/ext4: remove unused variable 'de' in ext4_init_new_dir()
@ 2025-08-13 18:24 Suchit Karunakaran
  2025-08-17 23:43 ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Suchit Karunakaran @ 2025-08-13 18:24 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4
  Cc: linux-kernel, linux-kernel-mentees, skhan, Suchit Karunakaran

The variable 'de' was declared but never used in the ext4_init_new_dir()
function, causing a compiler warning:
variable 'de' set but not used [-Werror=unused-but-set-variable]
Remove the unused declaration to clean up the code and fix the warning.

Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
---
 fs/ext4/namei.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index d83f91b62317..bb2370829928 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2965,7 +2965,6 @@ int ext4_init_new_dir(handle_t *handle, struct inode *dir,
 			     struct inode *inode)
 {
 	struct buffer_head *dir_block = NULL;
-	struct ext4_dir_entry_2 *de;
 	ext4_lblk_t block = 0;
 	int err;
 
@@ -2982,7 +2981,6 @@ int ext4_init_new_dir(handle_t *handle, struct inode *dir,
 	dir_block = ext4_append(handle, inode, &block);
 	if (IS_ERR(dir_block))
 		return PTR_ERR(dir_block);
-	de = (struct ext4_dir_entry_2 *)dir_block->b_data;
 	err = ext4_init_dirblock(handle, inode, dir_block, dir->i_ino, NULL, 0);
 	if (err)
 		goto out;
-- 
2.50.1


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

* Re: [PATCH RESEND] fs/ext4: remove unused variable 'de' in ext4_init_new_dir()
  2025-08-13 18:24 Suchit Karunakaran
@ 2025-08-17 23:43 ` Darrick J. Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2025-08-17 23:43 UTC (permalink / raw)
  To: Suchit Karunakaran
  Cc: tytso, adilger.kernel, linux-ext4, linux-kernel,
	linux-kernel-mentees, skhan

On Wed, Aug 13, 2025 at 11:54:40PM +0530, Suchit Karunakaran wrote:
> The variable 'de' was declared but never used in the ext4_init_new_dir()
> function, causing a compiler warning:
> variable 'de' set but not used [-Werror=unused-but-set-variable]
> Remove the unused declaration to clean up the code and fix the warning.
> 
> Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>

Gets rid of an annoying warning on my build system, so
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/ext4/namei.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index d83f91b62317..bb2370829928 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -2965,7 +2965,6 @@ int ext4_init_new_dir(handle_t *handle, struct inode *dir,
>  			     struct inode *inode)
>  {
>  	struct buffer_head *dir_block = NULL;
> -	struct ext4_dir_entry_2 *de;
>  	ext4_lblk_t block = 0;
>  	int err;
>  
> @@ -2982,7 +2981,6 @@ int ext4_init_new_dir(handle_t *handle, struct inode *dir,
>  	dir_block = ext4_append(handle, inode, &block);
>  	if (IS_ERR(dir_block))
>  		return PTR_ERR(dir_block);
> -	de = (struct ext4_dir_entry_2 *)dir_block->b_data;
>  	err = ext4_init_dirblock(handle, inode, dir_block, dir->i_ino, NULL, 0);
>  	if (err)
>  		goto out;
> -- 
> 2.50.1
> 
> 

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

* [PATCH RESEND] fs/ext4: remove unused variable 'de' in ext4_init_new_dir()
@ 2025-08-25 14:13 Suchit Karunakaran
  0 siblings, 0 replies; 3+ messages in thread
From: Suchit Karunakaran @ 2025-08-25 14:13 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4
  Cc: linux-kernel, linux-kernel-mentees, skhan, Suchit Karunakaran,
	Darrick J. Wong

The variable 'de' was declared but never used in the ext4_init_new_dir()
function, causing a compiler warning:
variable 'de' set but not used [-Werror=unused-but-set-variable]
Remove the unused declaration to clean up the code and fix the warning.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
---
 fs/ext4/namei.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index d83f91b62317..bb2370829928 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2965,7 +2965,6 @@ int ext4_init_new_dir(handle_t *handle, struct inode *dir,
 			     struct inode *inode)
 {
 	struct buffer_head *dir_block = NULL;
-	struct ext4_dir_entry_2 *de;
 	ext4_lblk_t block = 0;
 	int err;
 
@@ -2982,7 +2981,6 @@ int ext4_init_new_dir(handle_t *handle, struct inode *dir,
 	dir_block = ext4_append(handle, inode, &block);
 	if (IS_ERR(dir_block))
 		return PTR_ERR(dir_block);
-	de = (struct ext4_dir_entry_2 *)dir_block->b_data;
 	err = ext4_init_dirblock(handle, inode, dir_block, dir->i_ino, NULL, 0);
 	if (err)
 		goto out;
-- 
2.50.1


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

end of thread, other threads:[~2025-08-25 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25 14:13 [PATCH RESEND] fs/ext4: remove unused variable 'de' in ext4_init_new_dir() Suchit Karunakaran
  -- strict thread matches above, loose matches on Subject: below --
2025-08-13 18:24 Suchit Karunakaran
2025-08-17 23:43 ` Darrick J. Wong

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