提交 212240df 编写于 作者: S shengyong 提交者: Richard Weinberger

UBI: Fastmap: Use max() to get the larger value

Signed-off-by: NSheng Yong <shengyong1@huawei.com>
Signed-off-by: NRichard Weinberger <richard@nod.at>
上级 a1fe33af
...@@ -947,8 +947,8 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, ...@@ -947,8 +947,8 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
*/ */
ubi->fm_pool.max_size = min(((int)mtd_div_by_eb(ubi->mtd->size, ubi->fm_pool.max_size = min(((int)mtd_div_by_eb(ubi->mtd->size,
ubi->mtd) / 100) * 5, UBI_FM_MAX_POOL_SIZE); ubi->mtd) / 100) * 5, UBI_FM_MAX_POOL_SIZE);
if (ubi->fm_pool.max_size < UBI_FM_MIN_POOL_SIZE) ubi->fm_pool.max_size = max(ubi->fm_pool.max_size,
ubi->fm_pool.max_size = UBI_FM_MIN_POOL_SIZE; UBI_FM_MIN_POOL_SIZE);
ubi->fm_wl_pool.max_size = ubi->fm_pool.max_size / 2; ubi->fm_wl_pool.max_size = ubi->fm_pool.max_size / 2;
ubi->fm_disabled = !fm_autoconvert; ubi->fm_disabled = !fm_autoconvert;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册