public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ntfs3: avoid an unused variable warning
@ 2024-02-02 12:50 Arnd Bergmann
  2024-02-10 15:29 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2024-02-02 12:50 UTC (permalink / raw)
  To: Konstantin Komarov
  Cc: Arnd Bergmann, Christian Brauner, Jeff Layton, Jia-Ju Bai,
	Edward Lo, Abdun Nihaal, ntfs3, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

A newly introduced variable is only referenced in an #ifdef:

fs/ntfs3/frecord.c: In function 'ni_read_frame':
fs/ntfs3/frecord.c:2460:16: error: unused variable 'i_size' [-Werror=unused-variable]

Move it into the same conditional block.

Fixes: 4fd6c08a16d7 ("fs/ntfs3: Use i_size_read and i_size_write")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/ntfs3/frecord.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 3b42938a9d3b..7f27382e0ce2 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -2457,7 +2457,6 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,
 	struct ATTR_LIST_ENTRY *le = NULL;
 	struct runs_tree *run = &ni->file.run;
 	u64 valid_size = ni->i_valid;
-	loff_t i_size = i_size_read(&ni->vfs_inode);
 	u64 vbo_disk;
 	size_t unc_size;
 	u32 frame_size, i, npages_disk, ondisk_size;
@@ -2509,6 +2508,7 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,
 		err = -EOPNOTSUPP;
 		goto out1;
 #else
+		loff_t i_size = i_size_read(&ni->vfs_inode);
 		u32 frame_bits = ni_ext_compress_bits(ni);
 		u64 frame64 = frame_vbo >> frame_bits;
 		u64 frames, vbo_data;
-- 
2.39.2


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

* Re: [PATCH] ntfs3: avoid an unused variable warning
  2024-02-02 12:50 [PATCH] ntfs3: avoid an unused variable warning Arnd Bergmann
@ 2024-02-10 15:29 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2024-02-10 15:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Konstantin Komarov, Arnd Bergmann, Christian Brauner, Jeff Layton,
	Jia-Ju Bai, Edward Lo, Abdun Nihaal, ntfs3, linux-kernel

On Fri, Feb 02, 2024 at 01:50:56PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> A newly introduced variable is only referenced in an #ifdef:
> 
> fs/ntfs3/frecord.c: In function 'ni_read_frame':
> fs/ntfs3/frecord.c:2460:16: error: unused variable 'i_size' [-Werror=unused-variable]
> 
> Move it into the same conditional block.
> 
> Fixes: 4fd6c08a16d7 ("fs/ntfs3: Use i_size_read and i_size_write")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Tested-by: Guenter Roeck <linux@roeck-us.net>

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

end of thread, other threads:[~2024-02-10 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 12:50 [PATCH] ntfs3: avoid an unused variable warning Arnd Bergmann
2024-02-10 15:29 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox