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

The css variable in xchk_stats_estimate_bufsize() is initialized to
point to the start of the cs_stats array and incremented on every
iteration of the scan loop, but it is never dereferenced.  GCC flags
this as a dead assignment when building with W=1:

  fs/xfs/scrub/stats.c:146:34: warning: variable css 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/stats.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/xfs/scrub/stats.c b/fs/xfs/scrub/stats.c
index 6934d76cfd15..dfdac4e7b4ad 100644
--- a/fs/xfs/scrub/stats.c
+++ b/fs/xfs/scrub/stats.c
@@ -143,7 +143,6 @@ STATIC size_t
 xchk_stats_estimate_bufsize(
 	struct xchk_stats	*cs)
 {
-	struct xchk_scrub_stats	*css = &cs->cs_stats[0];
 	unsigned int		i;
 	size_t			field_width;
 	size_t			ret = 0;
@@ -157,7 +156,7 @@ xchk_stats_estimate_bufsize(
 			      offsetof(struct xchk_scrub_stats, checktime_us)) /
 			     sizeof(uint64_t));
 
-	for (i = 0; i < XFS_SCRUB_TYPE_NR; i++, css++) {
+	for (i = 0; i < XFS_SCRUB_TYPE_NR; i++) {
 		if (!name_map[i])
 			continue;
 
-- 
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  1:48 [PATCH] xfs: remove unused variable in xchk_stats_estimate_bufsize() 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®