From: David Sterba Date: Wed, 12 Feb 2025 20:22:05 +0000 (+0100) Subject: btrfs: zstd: remove local variable for storing page offsets X-Git-Tag: v6.15-rc1~152^2~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17b98249226aacfc8f7d4aba5a601a975ffed986;p=thirdparty%2Flinux.git btrfs: zstd: remove local variable for storing page offsets When using offset_in_page() it's clear what it means, we don't need to store it in the local variable just to use it right away. There's no change in the generated code, but keeps the declarations smaller. Signed-off-by: David Sterba --- diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c index 5419c47b854fc..cd5f38d6fbaa3 100644 --- a/fs/btrfs/zstd.c +++ b/fs/btrfs/zstd.c @@ -401,7 +401,6 @@ int zstd_compress_folios(struct list_head *ws, struct address_space *mapping, const unsigned long nr_dest_folios = *out_folios; const u64 orig_end = start + len; unsigned long max_out = nr_dest_folios * PAGE_SIZE; - unsigned int pg_off; unsigned int cur_len; workspace->params = zstd_get_btrfs_parameters(workspace->req_level, len); @@ -427,9 +426,8 @@ int zstd_compress_folios(struct list_head *ws, struct address_space *mapping, ret = btrfs_compress_filemap_get_folio(mapping, start, &in_folio); if (ret < 0) goto out; - pg_off = offset_in_page(start); cur_len = btrfs_calc_input_length(orig_end, start); - workspace->in_buf.src = kmap_local_folio(in_folio, pg_off); + workspace->in_buf.src = kmap_local_folio(in_folio, offset_in_page(start)); workspace->in_buf.pos = 0; workspace->in_buf.size = cur_len; @@ -513,9 +511,9 @@ int zstd_compress_folios(struct list_head *ws, struct address_space *mapping, ret = btrfs_compress_filemap_get_folio(mapping, start, &in_folio); if (ret < 0) goto out; - pg_off = offset_in_page(start); cur_len = btrfs_calc_input_length(orig_end, start); - workspace->in_buf.src = kmap_local_folio(in_folio, pg_off); + workspace->in_buf.src = kmap_local_folio(in_folio, + offset_in_page(start)); workspace->in_buf.pos = 0; workspace->in_buf.size = cur_len; }