everywhere: misc unnecessary var init/update

These are all cases where we initialise or update a variable, and then
never use it. None of them particularly matter, as the compiler should
optimise them all away during dead store elimination, but some static
analysers complain about them and they are extra work for casual readers
to follow, so worth removing.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #17551
This commit is contained in:
Rob Norris
2025-06-27 12:56:03 +10:00
committed by Brian Behlendorf
parent d2b9e66b88
commit bf38c15071
17 changed files with 30 additions and 38 deletions
+1 -2
View File
@@ -569,11 +569,10 @@ zfs_zstd_compress_buf(void *s_start, void *d_start, size_t s_len, size_t d_len,
size_t actual_abort_size = zstd_abort_size;
if (zstd_earlyabort_pass > 0 && zstd_level >= zstd_cutoff_level &&
s_len >= actual_abort_size) {
int pass_len = 1;
abd_t sabd, dabd;
abd_get_from_buf_struct(&sabd, s_start, s_len);
abd_get_from_buf_struct(&dabd, d_start, d_len);
pass_len = zfs_lz4_compress(&sabd, &dabd, s_len, d_len, 0);
int pass_len = zfs_lz4_compress(&sabd, &dabd, s_len, d_len, 0);
abd_free(&dabd);
abd_free(&sabd);
if (pass_len < d_len) {