mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xfs: remove unused variable in xrep_tempfile_copyin()
@ 2026-11-16  2:05 Yiqing Wu
  2026-11-16  6:00 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Yiqing Wu @ 2026-11-16  2:05 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: linux-xfs, linux-kernel, Yiqing Wu

The pos variable in xrep_tempfile_copyin() is initialized from the
starting file offset and incremented on every iteration of the copy
loop, but it is never used.  GCC flags this as a dead assignment when
building with W=1:

  fs/xfs/scrub/tempfile.c:493:33: warning: variable pos set but not used [-Wunused-but-set-variable=]

Drop the variable and the loop increment.

Signed-off-by: Yiqing Wu <wuyiqing@cmss.chinamobile.com>
---
 fs/xfs/scrub/tempfile.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/xfs/scrub/tempfile.c b/fs/xfs/scrub/tempfile.c
index 59a9213a3c7d..6340afcc22cf 100644
--- a/fs/xfs/scrub/tempfile.c
+++ b/fs/xfs/scrub/tempfile.c
@@ -490,7 +490,6 @@ xrep_tempfile_copyin(
 	struct xfs_buf		*bp;
 	xfs_fileoff_t		flush_mask;
 	xfs_fileoff_t		end = off + len;
-	loff_t			pos = XFS_FSB_TO_B(mp, off);
 	int			error = 0;
 
 	ASSERT(S_ISREG(VFS_I(sc->tempip)->i_mode));
@@ -498,7 +497,7 @@ xrep_tempfile_copyin(
 	/* Flush buffers to disk every 512K */
 	flush_mask = XFS_B_TO_FSBT(mp, (1U << 19)) - 1;
 
-	for (; off < end; off++, pos += mp->m_sb.sb_blocksize) {
+	for (; off < end; off++) {
 		struct xfs_bmbt_irec	map;
 		int			nmaps = 1;
 
-- 
2.56.0




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

end of thread, other threads:[~2026-11-16  6:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16  2:05 [PATCH] xfs: remove unused variable in xrep_tempfile_copyin() Yiqing Wu
2026-11-16  6:00 ` Christoph Hellwig

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

all inboxes | Powered by JetHome®