Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: receive: fix unused variable warning without LZO
@ 2026-09-29  7:14 liuh0329
  2026-09-29 10:37 ` Qu Wenruo
  0 siblings, 1 reply; 7+ messages in thread
From: liuh0329 @ 2026-09-29  7:14 UTC (permalink / raw)
  To: linux-btrfs; +Cc: liuh0329

When btrfs-progs is built without LZO support, sector_shift is still
declared in decompress_and_write(), while all its uses are guarded by
COMPRESSION_LZO. This results in an unused variable warning.

Guard the declaration with COMPRESSION_LZO as well.

Fixes: 345731fff32d ("btrfs-progs: receive: optional build for lzo, zstd")
Signed-off-by: liuh0329 <liuhuan01@kylinos.cn>
---
 cmds/receive.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmds/receive.c b/cmds/receive.c
index 49103ea3..14a9ba03 100644
--- a/cmds/receive.c
+++ b/cmds/receive.c
@@ -1186,7 +1186,9 @@ static int decompress_and_write(struct btrfs_receive *rctx,
 {
 	int ret = 0;
 	char *unencoded_data;
+#if COMPRESSION_LZO
 	int sector_shift = 0;
+#endif
 	u64 written = 0;
 
 	unencoded_data = calloc(unencoded_len, 1);
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-30  7:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-29  7:14 [PATCH] btrfs-progs: receive: fix unused variable warning without LZO liuh0329
2026-09-29 10:37 ` Qu Wenruo
2026-09-30  2:21   ` [PATCH v2] " liuh0329
2026-09-30  4:59     ` Qu Wenruo
2026-09-30  6:17       ` liuh
2026-09-30  6:43       ` [PATCH v3] " liuh0329
2026-09-30  7:39         ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox