Skip to contentSkip to conversation

btrfs-progs: simple cleanup related to LLVM (not LLM)

PATCH In review Qu Wenruo 2 participants 4 messages Oct 27 Btrfs file system

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

v2 cover btrfs-progs: simple cleanup related to LLVM (not LLM)

[CHANGELOG]
v2:
- Fix the second patch
Which added the GNUmakefile, not adding the file into .gitginore. Facepalm.

When using LLVM to compile btrfs-progs, two unused global variables are exposed. Fix them.

Secondly recently I move to use GNUmakefile to customize the make behavior, e.g. add "-j12" make flags, without modifying the existing Makefile.

Also add GNUmakefile to gitignore.

Qu Wenruo (2):
btrfs-progs: remove set but unused variables
btrfs-progs: gitignore: add GNUmakefile

 .gitignore                      | 1 +
 cmds/inspect-tree-stats.c       | 3 ---
 cmds/rescue-fix-data-checksum.c | 2 --
 3 files changed, 1 insertion(+), 5 deletions(-)

--
2.56.0

author
#1 lore raw

PATCH v2 1/2 btrfs-progs: remove set but unused variables

If using clang to compile btrfs-progs, two warnings will be reported:

cmds/rescue-fix-data-checksum.c:73:12: warning: variable 'global_repair_mode' set but not used [-Wunused-but-set-global]

    73 | static int global_repair_mode;
       |            ^
 1 warning generated.
 cmds/inspect-tree-stats.c:43:12: warning: variable 'verbose' set but not used [-Wunused-but-set-global]
    43 | static int verbose = 0;
       |            ^

1 warning generated.

Both are correct reports, so just remove them.

---
 cmds/inspect-tree-stats.c       | 3 ---
 cmds/rescue-fix-data-checksum.c | 2 --
 2 files changed, 5 deletions(-)
cmds/inspect-tree-stats.c +0 -3
index c6907bb0cd78..b45416fd16b7 100644
@@ -40,8 +40,6 @@
 #include "common/units.h"
 #include "cmds/commands.h"
 
-static int verbose = 0;
-
 struct seek {
 	u64 distance;
 	u64 count;
@@ -462,7 +460,6 @@ static int cmd_inspect_tree_stats(const struct cmd_struct *cmd,
 	while ((opt = getopt(argc, argv, "vbt:")) != -1) {
 		switch (opt) {
 		case 'v':
-			verbose++;
 			break;
 		case 'b':
 			unit_mode = UNITS_RAW;
cmds/rescue-fix-data-checksum.c +0 -2
index 3925d5170627..121fb0b46ca8 100644
@@ -70,7 +70,6 @@ static const struct fix_data_checksum_action {
 	},
 };
 
-static int global_repair_mode;
 LIST_HEAD(corrupted_blocks);
 
 static int add_corrupted_block(struct btrfs_fs_info *fs_info, u64 logical,
@@ -486,7 +485,6 @@ int btrfs_recover_fix_data_checksum(const char *path, enum btrfs_fix_data_checks
 		return -EBUSY;
 	}
 
-	global_repair_mode = mode;
 	oca.filename = path;
 	oca.flags = OPEN_CTREE_WRITES;
 	fs_info = open_ctree_fs_info(&oca);
Signature · 1 line
2.56.0
author
#2 lore raw

PATCH v2 2/2 btrfs-progs: gitignore: add GNUmakefile

In reply to Qu Wenruo

I use GNUmakefile to add extra compiling flags without modifying the existing Makefile:

MAKEFLAGS += -j12
include Makefile

So the GNUmakefile is more or less reflecting personal tastes, better to add it to gitignore.

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
.gitignore +1 -0
index 7cbd83f79676..78333d679a7d 100644
@@ -71,6 +71,7 @@
 /cscope.in.out
 /cscope.po.out
 /compile_commands.json
+/GNUmakefile
 .*
 !.editorconfig
 !.github
Signature · 1 line
2.56.0
Reviewed-by on the v2 series
#3 lore raw
In reply to Qu Wenruo
Quoted 14 lines · Qu Wenruo

[CHANGELOG]
v2:
- Fix the second patch
Which added the GNUmakefile, not adding the file into .gitginore. Facepalm.

When using LLVM to compile btrfs-progs, two unused global variables are exposed. Fix them.

Secondly recently I move to use GNUmakefile to customize the make behavior, e.g. add "-j12" make flags, without modifying the existing Makefile.

Also add GNUmakefile to gitignore.

Quoted 8 lines

Qu Wenruo (2):
btrfs-progs: remove set but unused variables
btrfs-progs: gitignore: add GNUmakefile

 .gitignore                      | 1 +
 cmds/inspect-tree-stats.c       | 3 ---
 cmds/rescue-fix-data-checksum.c | 2 --
 3 files changed, 1 insertion(+), 5 deletions(-)

For the series:

Thanks

Quoted 4 lines

--
2.56.0