--- zzzz-none-000/linux-5.15.111/drivers/mtd/ubi/wl.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-arm-6670-761/linux-5.15.111/drivers/mtd/ubi/wl.c 2024-02-07 09:27:49.000000000 +0000 @@ -6,6 +6,11 @@ */ /* + * Includes Intel Corporation's changes/modifications dated: 2017. + * Changed/modified portions - Copyright (c) 2017, Intel Corporation. + */ + +/* * UBI wear-leveling sub-system. * * This sub-system is responsible for wear-leveling. It works in terms of @@ -122,11 +127,17 @@ */ #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. @@ -1966,6 +1977,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