Skip to content

Commit 9efabc8

Browse files
committed
UBI: do not link debug messages when debugging is disabled
Michal Marek spotted the same issue in UBIFS and this patch fixes UBI, see "UBIFS: not build debug messages with CONFIG_UBIFS_FS_DEBUG disabled" When UBI debugging is disabled, we have debugging messages defined as: if (0) pr_debug() But pr_debug macro defines data structures with debugging data and makes the linux binary larger, even though we have "if (0)". Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
1 parent 93ee7a9 commit 9efabc8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/mtd/ubi/debug.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static inline int ubi_dbg_is_erase_failure(const struct ubi_device *ubi)
181181

182182
#define ubi_dbg_msg(fmt, ...) do { \
183183
if (0) \
184-
pr_debug(fmt "\n", ##__VA_ARGS__); \
184+
printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \
185185
} while (0)
186186

187187
#define dbg_msg(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__)

0 commit comments

Comments
 (0)