Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 -1
+1 -1
drivers/mtd/ubi/debug.h
··· 181 181 182 182 #define ubi_dbg_msg(fmt, ...) do { \ 183 183 if (0) \ 184 - pr_debug(fmt "\n", ##__VA_ARGS__); \ 184 + printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \ 185 185 } while (0) 186 186 187 187 #define dbg_msg(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__)