xfs: remove unused variable in xchk_stats_estimate_bufsize()
PATCH 1/1 xfs: remove unused variable in xchk_stats_estimate_bufsize()
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.
--- fs/xfs/scrub/stats.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/scrub/stats.c +1 -2
@@ -143,7 +143,6 @@ STATIC size_txchk_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 ;
Signature · 1 line
2.56.0
Looks good:
Quoted 8 lines · Yiqing Wu
The css variable in
xchk_stats_estimate_bufsize()is initialized to point to the start of thecs_statsarray 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=][...]
Applied to for-next, thanks!
[1/1] xfs: remove unused variable in xchk_stats_estimate_bufsize()
commit: 56b3c41b05ae2fc342ac874757d65482322eb360
Best regards,
Signature · 1 line
Carlos Maiolino <[email protected]>