Skip to content

Commit

Permalink
UBI: do not link debug messages when debugging is disabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Artem Bityutskiy committed Aug 19, 2011
1 parent 93ee7a9 commit 9efabc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/ubi/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static inline int ubi_dbg_is_erase_failure(const struct ubi_device *ubi)

#define ubi_dbg_msg(fmt, ...) do { \
if (0) \
pr_debug(fmt "\n", ##__VA_ARGS__); \
printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \
} while (0)

#define dbg_msg(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__)
Expand Down

0 comments on commit 9efabc8

Please sign in to comment.