summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/debug.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-03-11 09:15:23 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-06 10:17:53 +0200
commiteea6d75d1bfa91ff5da7992ecbc1ff828542c342 (patch)
treeafb45ff26e7730ee113d6702701757e910423fc0 /drivers/mtd/ubi/debug.h
parente4715ba031ef75ea2fa286aed153c7e722a2fa23 (diff)
downloadbarebox-eea6d75d1bfa91ff5da7992ecbc1ff828542c342.tar.gz
barebox-eea6d75d1bfa91ff5da7992ecbc1ff828542c342.tar.xz
mtd: ubi: Make debug options configurable
This makes the UBI debug options configurable. This make the debug options actually available to the user and also allows the compiler to optimize away the debug code when the options are disabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/ubi/debug.h')
-rw-r--r--drivers/mtd/ubi/debug.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h
index c1b41b4d75..511e454364 100644
--- a/drivers/mtd/ubi/debug.h
+++ b/drivers/mtd/ubi/debug.h
@@ -74,11 +74,17 @@ static inline int ubi_dbg_is_bgt_disabled(const struct ubi_device *ubi)
static inline int ubi_dbg_chk_io(const struct ubi_device *ubi)
{
- return ubi->dbg.chk_io;
+ if (IS_ENABLED(CONFIG_MTD_UBI_CHECK_IO))
+ return 1;
+ else
+ return 0;
}
static inline int ubi_dbg_chk_gen(const struct ubi_device *ubi)
{
- return ubi->dbg.chk_gen;
+ if (IS_ENABLED(CONFIG_MTD_UBI_GENERAL_EXTRA_CHECKS))
+ return 1;
+ else
+ return 0;
}
#endif /* !__UBI_DEBUG_H__ */