summaryrefslogtreecommitdiff
path: root/ubifs-utils/common/defs.h
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2024-11-11 16:36:36 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2024-11-11 10:32:45 +0100
commit6a4a0c16329b6649d5eb00d318d8a95503e3597a (patch)
treed154b290e3f5591567e8d119bd9641c87d3fc94a /ubifs-utils/common/defs.h
parent14aa5e63ab989e4f85495e96a74f34d18813caf6 (diff)
ubifs-utils: Move 'debug_level' into ubifs_info structure
Embed new member 'debug_level' into 'ubifs_info' structure, then global variable 'debug_level' can be removed from mkfs.ubifs.c. Next patches will import UBIFS libs from linux kernel, which could print messages with different levels, then 'debug_level' can be used to control which level messages should be printed. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/common/defs.h')
-rw-r--r--ubifs-utils/common/defs.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/ubifs-utils/common/defs.h b/ubifs-utils/common/defs.h
index 3dafc6d..cafc94a 100644
--- a/ubifs-utils/common/defs.h
+++ b/ubifs-utils/common/defs.h
@@ -23,9 +23,7 @@ extern struct ubifs_info info_;
enum { MKFS_PROGRAM_TYPE = 0 };
-extern int debug_level;
-
-#define dbg_msg(lvl, fmt, ...) do {if (debug_level >= lvl) \
+#define dbg_msg(lvl, fmt, ...) do {if (info_.debug_level >= lvl) \
printf("%s: %s: " fmt "\n", PROGRAM_NAME, __FUNCTION__, ##__VA_ARGS__); \
} while(0)