diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-16 11:09:08 -0400 |
|---|---|---|
| committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-20 13:26:00 -0400 |
| commit | aa44d1d35f3485e0acea0f22e41cb472d2c99858 (patch) | |
| tree | b066ebf877a3eba5cb154b4d78f8bad6c86c1cfd | |
| parent | 718c00bb8fb00c68977f1076619cdfb050f92ba5 (diff) | |
UBI: remove Kconfig debugging option
This patch kills the UBI debugging Kconfig option completely and makes all the
debugging stuff to be always compiled-in. It was pain in the neck to maintain
this useless option because all users I am aware of have debugging enabled
anyway - how else will you diagnose errors otherwise?
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| -rw-r--r-- | drivers/mtd/ubi/Kconfig | 8 | ||||
| -rw-r--r-- | drivers/mtd/ubi/debug.c | 4 | ||||
| -rw-r--r-- | drivers/mtd/ubi/debug.h | 63 | ||||
| -rw-r--r-- | drivers/mtd/ubi/io.c | 12 | ||||
| -rw-r--r-- | drivers/mtd/ubi/scan.c | 8 | ||||
| -rw-r--r-- | drivers/mtd/ubi/vmt.c | 7 | ||||
| -rw-r--r-- | drivers/mtd/ubi/vtbl.c | 8 | ||||
| -rw-r--r-- | drivers/mtd/ubi/wl.c | 10 |
8 files changed, 0 insertions, 120 deletions
diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig index 4dcc752a0c0b..738ee8dc16cd 100644 --- a/drivers/mtd/ubi/Kconfig +++ b/drivers/mtd/ubi/Kconfig | |||
| @@ -52,12 +52,4 @@ config MTD_UBI_GLUEBI | |||
| 52 | work on top of UBI. Do not enable this unless you use legacy | 52 | work on top of UBI. Do not enable this unless you use legacy |
| 53 | software. | 53 | software. |
| 54 | 54 | ||
| 55 | config MTD_UBI_DEBUG | ||
| 56 | bool "UBI debugging" | ||
| 57 | depends on SYSFS | ||
| 58 | select DEBUG_FS | ||
| 59 | select KALLSYMS | ||
| 60 | help | ||
| 61 | This option enables UBI debugging. | ||
| 62 | |||
| 63 | endif # MTD_UBI | 55 | endif # MTD_UBI |
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c index bb7297ebf1c1..c6becde40314 100644 --- a/drivers/mtd/ubi/debug.c +++ b/drivers/mtd/ubi/debug.c | |||
| @@ -106,8 +106,6 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr) | |||
| 106 | vid_hdr, UBI_VID_HDR_SIZE, 1); | 106 | vid_hdr, UBI_VID_HDR_SIZE, 1); |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 110 | |||
| 111 | /** | 109 | /** |
| 112 | * ubi_dump_vol_info - dump volume information. | 110 | * ubi_dump_vol_info - dump volume information. |
| 113 | * @vol: UBI volume description object | 111 | * @vol: UBI volume description object |
| @@ -474,5 +472,3 @@ void ubi_debugfs_exit_dev(struct ubi_device *ubi) | |||
| 474 | { | 472 | { |
| 475 | debugfs_remove_recursive(ubi->dbg->dfs_dir); | 473 | debugfs_remove_recursive(ubi->dbg->dfs_dir); |
| 476 | } | 474 | } |
| 477 | |||
| 478 | #endif /* CONFIG_MTD_UBI_DEBUG */ | ||
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index c98d2c8d3abe..3e5b60f3fdf1 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h | |||
| @@ -25,7 +25,6 @@ void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len); | |||
| 25 | void ubi_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr); | 25 | void ubi_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr); |
| 26 | void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); | 26 | void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); |
| 27 | 27 | ||
| 28 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 29 | #include <linux/random.h> | 28 | #include <linux/random.h> |
| 30 | 29 | ||
| 31 | #define ubi_assert(expr) do { \ | 30 | #define ubi_assert(expr) do { \ |
| @@ -166,66 +165,4 @@ static inline int ubi_dbg_is_erase_failure(const struct ubi_device *ubi) | |||
| 166 | return 0; | 165 | return 0; |
| 167 | } | 166 | } |
| 168 | 167 | ||
| 169 | #else | ||
| 170 | |||
| 171 | /* Use "if (0)" to make compiler check arguments even if debugging is off */ | ||
| 172 | #define ubi_assert(expr) do { \ | ||
| 173 | if (0) { \ | ||
| 174 | printk(KERN_CRIT "UBI assert failed in %s at %u (pid %d)\n", \ | ||
| 175 | __func__, __LINE__, current->pid); \ | ||
| 176 | } \ | ||
| 177 | } while (0) | ||
| 178 | |||
| 179 | #define dbg_err(fmt, ...) do { \ | ||
| 180 | if (0) \ | ||
| 181 | ubi_err(fmt, ##__VA_ARGS__); \ | ||
| 182 | } while (0) | ||
| 183 | |||
| 184 | #define ubi_dbg_msg(fmt, ...) do { \ | ||
| 185 | if (0) \ | ||
| 186 | printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \ | ||
| 187 | } while (0) | ||
| 188 | |||
| 189 | #define dbg_msg(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__) | ||
| 190 | #define dbg_gen(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__) | ||
| 191 | #define dbg_eba(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__) | ||
| 192 | #define dbg_wl(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__) | ||
| 193 | #define dbg_io(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__) | ||
| 194 | #define dbg_bld(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__) | ||
| 195 | |||
| 196 | static inline void | ||
| 197 | ubi_dump_vol_info(const struct ubi_volume *vol) { return; } | ||
| 198 | static inline void | ||
| 199 | ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx) { return; } | ||
| 200 | static inline void ubi_dump_sv(const struct ubi_scan_volume *sv) { return; } | ||
| 201 | static inline void ubi_dump_seb(const struct ubi_scan_leb *seb, | ||
| 202 | int type) { return; } | ||
| 203 | static inline void | ||
| 204 | ubi_dump_mkvol_req(const struct ubi_mkvol_req *req) { return; } | ||
| 205 | static inline void | ||
| 206 | ubi_dbg_print_hex_dump(const char *l, const char *ps, int pt, int r, | ||
| 207 | int g, const void *b, size_t len, bool a) { return; } | ||
| 208 | static inline int ubi_dbg_check_all_ff(struct ubi_device *ubi, | ||
| 209 | int pnum, int offset, | ||
| 210 | int len) { return 0; } | ||
| 211 | static inline int ubi_dbg_check_write(struct ubi_device *ubi, | ||
| 212 | const void *buf, int pnum, | ||
| 213 | int offset, int len) { return 0; } | ||
| 214 | |||
| 215 | static inline int ubi_debugging_init_dev(struct ubi_device *ubi) { return 0; } | ||
| 216 | static inline void ubi_debugging_exit_dev(struct ubi_device *ubi) { return; } | ||
| 217 | static inline int ubi_debugfs_init(void) { return 0; } | ||
| 218 | static inline void ubi_debugfs_exit(void) { return; } | ||
| 219 | static inline int ubi_debugfs_init_dev(struct ubi_device *ubi) { return 0; } | ||
| 220 | static inline void ubi_debugfs_exit_dev(struct ubi_device *ubi) { return; } | ||
| 221 | |||
| 222 | static inline int | ||
| 223 | ubi_dbg_is_bgt_disabled(const struct ubi_device *ubi) { return 0; } | ||
| 224 | static inline int ubi_dbg_is_bitflip(const struct ubi_device *ubi) { return 0; } | ||
| 225 | static inline int | ||
| 226 | ubi_dbg_is_write_failure(const struct ubi_device *ubi) { return 0; } | ||
| 227 | static inline int | ||
| 228 | ubi_dbg_is_erase_failure(const struct ubi_device *ubi) { return 0; } | ||
| 229 | |||
| 230 | #endif /* !CONFIG_MTD_UBI_DEBUG */ | ||
| 231 | #endif /* !__UBI_DEBUG_H__ */ | 168 | #endif /* !__UBI_DEBUG_H__ */ |
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 19ee1a821557..c1628fc706c1 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
| @@ -91,7 +91,6 @@ | |||
| 91 | #include <linux/slab.h> | 91 | #include <linux/slab.h> |
| 92 | #include "ubi.h" | 92 | #include "ubi.h" |
| 93 | 93 | ||
| 94 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 95 | static int paranoid_check_not_bad(const struct ubi_device *ubi, int pnum); | 94 | static int paranoid_check_not_bad(const struct ubi_device *ubi, int pnum); |
| 96 | static int paranoid_check_peb_ec_hdr(const struct ubi_device *ubi, int pnum); | 95 | static int paranoid_check_peb_ec_hdr(const struct ubi_device *ubi, int pnum); |
| 97 | static int paranoid_check_ec_hdr(const struct ubi_device *ubi, int pnum, | 96 | static int paranoid_check_ec_hdr(const struct ubi_device *ubi, int pnum, |
| @@ -99,13 +98,6 @@ static int paranoid_check_ec_hdr(const struct ubi_device *ubi, int pnum, | |||
| 99 | static int paranoid_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum); | 98 | static int paranoid_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum); |
| 100 | static int paranoid_check_vid_hdr(const struct ubi_device *ubi, int pnum, | 99 | static int paranoid_check_vid_hdr(const struct ubi_device *ubi, int pnum, |
| 101 | const struct ubi_vid_hdr *vid_hdr); | 100 | const struct ubi_vid_hdr *vid_hdr); |
| 102 | #else | ||
| 103 | #define paranoid_check_not_bad(ubi, pnum) 0 | ||
| 104 | #define paranoid_check_peb_ec_hdr(ubi, pnum) 0 | ||
| 105 | #define paranoid_check_ec_hdr(ubi, pnum, ec_hdr) 0 | ||
| 106 | #define paranoid_check_peb_vid_hdr(ubi, pnum) 0 | ||
| 107 | #define paranoid_check_vid_hdr(ubi, pnum, vid_hdr) 0 | ||
| 108 | #endif | ||
| 109 | 101 | ||
| 110 | /** | 102 | /** |
| 111 | * ubi_io_read - read data from a physical eraseblock. | 103 | * ubi_io_read - read data from a physical eraseblock. |
| @@ -1131,8 +1123,6 @@ int ubi_io_write_vid_hdr(struct ubi_device *ubi, int pnum, | |||
| 1131 | return err; | 1123 | return err; |
| 1132 | } | 1124 | } |
| 1133 | 1125 | ||
| 1134 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 1135 | |||
| 1136 | /** | 1126 | /** |
| 1137 | * paranoid_check_not_bad - ensure that a physical eraseblock is not bad. | 1127 | * paranoid_check_not_bad - ensure that a physical eraseblock is not bad. |
| 1138 | * @ubi: UBI device description object | 1128 | * @ubi: UBI device description object |
| @@ -1447,5 +1437,3 @@ error: | |||
| 1447 | vfree(buf); | 1437 | vfree(buf); |
| 1448 | return err; | 1438 | return err; |
| 1449 | } | 1439 | } |
| 1450 | |||
| 1451 | #endif /* CONFIG_MTD_UBI_DEBUG */ | ||
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index b09c8fa0c670..bcbfe498f415 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
| @@ -88,11 +88,7 @@ | |||
| 88 | #include <linux/random.h> | 88 | #include <linux/random.h> |
| 89 | #include "ubi.h" | 89 | #include "ubi.h" |
| 90 | 90 | ||
| 91 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 92 | static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si); | 91 | static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si); |
| 93 | #else | ||
| 94 | #define paranoid_check_si(ubi, si) 0 | ||
| 95 | #endif | ||
| 96 | 92 | ||
| 97 | /* Temporary variables used during scanning */ | 93 | /* Temporary variables used during scanning */ |
| 98 | static struct ubi_ec_hdr *ech; | 94 | static struct ubi_ec_hdr *ech; |
| @@ -1329,8 +1325,6 @@ void ubi_scan_destroy_si(struct ubi_scan_info *si) | |||
| 1329 | kfree(si); | 1325 | kfree(si); |
| 1330 | } | 1326 | } |
| 1331 | 1327 | ||
| 1332 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 1333 | |||
| 1334 | /** | 1328 | /** |
| 1335 | * paranoid_check_si - check the scanning information. | 1329 | * paranoid_check_si - check the scanning information. |
| 1336 | * @ubi: UBI device description object | 1330 | * @ubi: UBI device description object |
| @@ -1601,5 +1595,3 @@ out: | |||
| 1601 | dump_stack(); | 1595 | dump_stack(); |
| 1602 | return -EINVAL; | 1596 | return -EINVAL; |
| 1603 | } | 1597 | } |
| 1604 | |||
| 1605 | #endif /* CONFIG_MTD_UBI_DEBUG */ | ||
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index a4b4c300a4e1..b38ab92094fd 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c | |||
| @@ -29,11 +29,7 @@ | |||
| 29 | #include <linux/export.h> | 29 | #include <linux/export.h> |
| 30 | #include "ubi.h" | 30 | #include "ubi.h" |
| 31 | 31 | ||
| 32 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 33 | static int paranoid_check_volumes(struct ubi_device *ubi); | 32 | static int paranoid_check_volumes(struct ubi_device *ubi); |
| 34 | #else | ||
| 35 | #define paranoid_check_volumes(ubi) 0 | ||
| 36 | #endif | ||
| 37 | 33 | ||
| 38 | static ssize_t vol_attribute_show(struct device *dev, | 34 | static ssize_t vol_attribute_show(struct device *dev, |
| 39 | struct device_attribute *attr, char *buf); | 35 | struct device_attribute *attr, char *buf); |
| @@ -712,8 +708,6 @@ void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol) | |||
| 712 | volume_sysfs_close(vol); | 708 | volume_sysfs_close(vol); |
| 713 | } | 709 | } |
| 714 | 710 | ||
| 715 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 716 | |||
| 717 | /** | 711 | /** |
| 718 | * paranoid_check_volume - check volume information. | 712 | * paranoid_check_volume - check volume information. |
| 719 | * @ubi: UBI device description object | 713 | * @ubi: UBI device description object |
| @@ -883,4 +877,3 @@ static int paranoid_check_volumes(struct ubi_device *ubi) | |||
| 883 | 877 | ||
| 884 | return err; | 878 | return err; |
| 885 | } | 879 | } |
| 886 | #endif | ||
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index b37872cc5218..277f1546cb9e 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c | |||
| @@ -62,11 +62,7 @@ | |||
| 62 | #include <asm/div64.h> | 62 | #include <asm/div64.h> |
| 63 | #include "ubi.h" | 63 | #include "ubi.h" |
| 64 | 64 | ||
| 65 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 66 | static void paranoid_vtbl_check(const struct ubi_device *ubi); | 65 | static void paranoid_vtbl_check(const struct ubi_device *ubi); |
| 67 | #else | ||
| 68 | #define paranoid_vtbl_check(ubi) | ||
| 69 | #endif | ||
| 70 | 66 | ||
| 71 | /* Empty volume table record */ | 67 | /* Empty volume table record */ |
| 72 | static struct ubi_vtbl_record empty_vtbl_record; | 68 | static struct ubi_vtbl_record empty_vtbl_record; |
| @@ -858,8 +854,6 @@ out_free: | |||
| 858 | return err; | 854 | return err; |
| 859 | } | 855 | } |
| 860 | 856 | ||
| 861 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 862 | |||
| 863 | /** | 857 | /** |
| 864 | * paranoid_vtbl_check - check volume table. | 858 | * paranoid_vtbl_check - check volume table. |
| 865 | * @ubi: UBI device description object | 859 | * @ubi: UBI device description object |
| @@ -874,5 +868,3 @@ static void paranoid_vtbl_check(const struct ubi_device *ubi) | |||
| 874 | BUG(); | 868 | BUG(); |
| 875 | } | 869 | } |
| 876 | } | 870 | } |
| 877 | |||
| 878 | #endif /* CONFIG_MTD_UBI_DEBUG */ | ||
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 64ce9930dacb..f99dbd084838 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c | |||
| @@ -155,18 +155,12 @@ struct ubi_work { | |||
| 155 | int torture; | 155 | int torture; |
| 156 | }; | 156 | }; |
| 157 | 157 | ||
| 158 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 159 | static int paranoid_check_ec(struct ubi_device *ubi, int pnum, int ec); | 158 | static int paranoid_check_ec(struct ubi_device *ubi, int pnum, int ec); |
| 160 | static int paranoid_check_in_wl_tree(const struct ubi_device *ubi, | 159 | static int paranoid_check_in_wl_tree(const struct ubi_device *ubi, |
| 161 | struct ubi_wl_entry *e, | 160 | struct ubi_wl_entry *e, |
| 162 | struct rb_root *root); | 161 | struct rb_root *root); |
| 163 | static int paranoid_check_in_pq(const struct ubi_device *ubi, | 162 | static int paranoid_check_in_pq(const struct ubi_device *ubi, |
| 164 | struct ubi_wl_entry *e); | 163 | struct ubi_wl_entry *e); |
| 165 | #else | ||
| 166 | #define paranoid_check_ec(ubi, pnum, ec) 0 | ||
| 167 | #define paranoid_check_in_wl_tree(ubi, e, root) | ||
| 168 | #define paranoid_check_in_pq(ubi, e) 0 | ||
| 169 | #endif | ||
| 170 | 164 | ||
| 171 | /** | 165 | /** |
| 172 | * wl_tree_add - add a wear-leveling entry to a WL RB-tree. | 166 | * wl_tree_add - add a wear-leveling entry to a WL RB-tree. |
| @@ -1526,8 +1520,6 @@ void ubi_wl_close(struct ubi_device *ubi) | |||
| 1526 | kfree(ubi->lookuptbl); | 1520 | kfree(ubi->lookuptbl); |
| 1527 | } | 1521 | } |
| 1528 | 1522 | ||
| 1529 | #ifdef CONFIG_MTD_UBI_DEBUG | ||
| 1530 | |||
| 1531 | /** | 1523 | /** |
| 1532 | * paranoid_check_ec - make sure that the erase counter of a PEB is correct. | 1524 | * paranoid_check_ec - make sure that the erase counter of a PEB is correct. |
| 1533 | * @ubi: UBI device description object | 1525 | * @ubi: UBI device description object |
| @@ -1624,5 +1616,3 @@ static int paranoid_check_in_pq(const struct ubi_device *ubi, | |||
| 1624 | dump_stack(); | 1616 | dump_stack(); |
| 1625 | return -EINVAL; | 1617 | return -EINVAL; |
| 1626 | } | 1618 | } |
| 1627 | |||
| 1628 | #endif /* CONFIG_MTD_UBI_DEBUG */ | ||
