]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: zstd: remove local variable for storing page offsets
authorDavid Sterba <dsterba@suse.com>
Wed, 12 Feb 2025 20:22:05 +0000 (21:22 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Mar 2025 19:35:42 +0000 (20:35 +0100)
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 <dsterba@suse.com>
fs/btrfs/zstd.c

index 5419c47b854fc77edc21025264230f75c829169a..cd5f38d6fbaa3c41a451153c8e2d05f08126642b 100644 (file)
@@ -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;
                }