[PATCH] xfs: remove unused variable in xchk_stats_estimate_bufsize()

From: Yiqing Wu

Date: Sun Nov 15 2026 - 20:49:02 EST


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@xxxxxxxxxxxxxxxxxxxx>
---
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