--- zzzz-none-000/linux-4.9.279/drivers/mtd/ubi/wl.c 2021-08-08 06:38:54.000000000 +0000 +++ puma7-atom-6591-750/linux-4.9.279/drivers/mtd/ubi/wl.c 2023-02-08 11:43:42.000000000 +0000 @@ -135,11 +135,18 @@ */ #define WL_MAX_FAILURES 32 +#ifdef CONFIG_MTD_UBI_DEBUG static int self_check_ec(struct ubi_device *ubi, int pnum, int ec); static int self_check_in_wl_tree(const struct ubi_device *ubi, struct ubi_wl_entry *e, struct rb_root *root); static int self_check_in_pq(const struct ubi_device *ubi, struct ubi_wl_entry *e); +#else +#define self_check_ec(ubi, pnum, ec) 0 +#define self_check_in_wl_tree(ubi, e, root) +#define self_check_in_pq(ubi, e) 0 +#endif + /** * wl_tree_add - add a wear-leveling entry to a WL RB-tree. @@ -1782,6 +1789,8 @@ kfree(ubi->lookuptbl); } +#ifdef CONFIG_MTD_UBI_DEBUG + /** * self_check_ec - make sure that the erase counter of a PEB is correct. * @ubi: UBI device description object @@ -1877,6 +1886,8 @@ dump_stack(); return -EINVAL; } +#endif /* CONFIG_MTD_UBI_DEBUG */ + #ifndef CONFIG_MTD_UBI_FASTMAP static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi) {