diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-05-12 08:10:03 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-05-18 05:28:25 -0400 |
commit | 2cb81e218f336dc5438a960d1ae098188db9ff11 (patch) | |
tree | 27e48e70a69083966c4bfa195083c9132b1973ac /drivers/mtd/ubi | |
parent | e1cf7e6dd4ffd4391391e4e08b0fd44681b0e74d (diff) |
UBI: small debugging code optimization
The @ubi->dbg_peb_buf is needed only when paranoid checks are
enabled, not when debugging in general is enabled.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r-- | drivers/mtd/ubi/build.c | 6 | ||||
-rw-r--r-- | drivers/mtd/ubi/ubi.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 5d8fda1bda7f..2c3269ea133d 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c | |||
@@ -824,7 +824,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) | |||
824 | if (!ubi->peb_buf2) | 824 | if (!ubi->peb_buf2) |
825 | goto out_free; | 825 | goto out_free; |
826 | 826 | ||
827 | #ifdef CONFIG_MTD_UBI_DEBUG | 827 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID |
828 | mutex_init(&ubi->dbg_buf_mutex); | 828 | mutex_init(&ubi->dbg_buf_mutex); |
829 | ubi->dbg_peb_buf = vmalloc(ubi->peb_size); | 829 | ubi->dbg_peb_buf = vmalloc(ubi->peb_size); |
830 | if (!ubi->dbg_peb_buf) | 830 | if (!ubi->dbg_peb_buf) |
@@ -891,7 +891,7 @@ out_detach: | |||
891 | out_free: | 891 | out_free: |
892 | vfree(ubi->peb_buf1); | 892 | vfree(ubi->peb_buf1); |
893 | vfree(ubi->peb_buf2); | 893 | vfree(ubi->peb_buf2); |
894 | #ifdef CONFIG_MTD_UBI_DEBUG | 894 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID |
895 | vfree(ubi->dbg_peb_buf); | 895 | vfree(ubi->dbg_peb_buf); |
896 | #endif | 896 | #endif |
897 | kfree(ubi); | 897 | kfree(ubi); |
@@ -960,7 +960,7 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway) | |||
960 | put_mtd_device(ubi->mtd); | 960 | put_mtd_device(ubi->mtd); |
961 | vfree(ubi->peb_buf1); | 961 | vfree(ubi->peb_buf1); |
962 | vfree(ubi->peb_buf2); | 962 | vfree(ubi->peb_buf2); |
963 | #ifdef CONFIG_MTD_UBI_DEBUG | 963 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID |
964 | vfree(ubi->dbg_peb_buf); | 964 | vfree(ubi->dbg_peb_buf); |
965 | #endif | 965 | #endif |
966 | ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num); | 966 | ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num); |
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index 76ec79b156a1..749007e9f1aa 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h | |||
@@ -443,7 +443,7 @@ struct ubi_device { | |||
443 | void *peb_buf2; | 443 | void *peb_buf2; |
444 | struct mutex buf_mutex; | 444 | struct mutex buf_mutex; |
445 | struct mutex ckvol_mutex; | 445 | struct mutex ckvol_mutex; |
446 | #ifdef CONFIG_MTD_UBI_DEBUG | 446 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID |
447 | void *dbg_peb_buf; | 447 | void *dbg_peb_buf; |
448 | struct mutex dbg_buf_mutex; | 448 | struct mutex dbg_buf_mutex; |
449 | #endif | 449 | #endif |