btrfs: remove out label in lzo_decompress()
authorFilipe Manana <fdmanana@suse.com>
Tue, 20 Jan 2026 20:04:26 +0000 (20:04 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:56:22 +0000 (07:56 +0100)
There is no point in having the label since all it does is return the
value in the 'ret' variable. Instead make every goto return directly
and remove the label.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/lzo.c

index 4024ce4..bd5ee82 100644 (file)
@@ -484,7 +484,7 @@ int lzo_decompress(struct list_head *ws, const u8 *data_in,
        size_t in_len;
        size_t out_len;
        size_t max_segment_len = workspace_buf_length(fs_info);
-       int ret = 0;
+       int ret;
 
        if (unlikely(srclen < LZO_LEN || srclen > max_segment_len + LZO_LEN * 2))
                return -EUCLEAN;
@@ -495,10 +495,8 @@ int lzo_decompress(struct list_head *ws, const u8 *data_in,
        data_in += LZO_LEN;
 
        in_len = read_compress_length(data_in);
-       if (unlikely(in_len != srclen - LZO_LEN * 2)) {
-               ret = -EUCLEAN;
-               goto out;
-       }
+       if (unlikely(in_len != srclen - LZO_LEN * 2))
+               return -EUCLEAN;
        data_in += LZO_LEN;
 
        out_len = sectorsize;
@@ -510,19 +508,18 @@ int lzo_decompress(struct list_head *ws, const u8 *data_in,
                "lzo decompression failed, error %d root %llu inode %llu offset %llu",
                          ret, btrfs_root_id(inode->root), btrfs_ino(inode),
                          folio_pos(dest_folio));
-               ret = -EIO;
-               goto out;
+               return -EIO;
        }
 
        ASSERT(out_len <= sectorsize);
        memcpy_to_folio(dest_folio, dest_pgoff, workspace->buf, out_len);
        /* Early end, considered as an error. */
        if (unlikely(out_len < destlen)) {
-               ret = -EIO;
                folio_zero_range(dest_folio, dest_pgoff + out_len, destlen - out_len);
+               return -EIO;
        }
-out:
-       return ret;
+
+       return 0;
 }
 
 const struct btrfs_compress_levels  btrfs_lzo_compress = {