Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d74363a authored by shengyong's avatar shengyong Committed by Ian Maund
Browse files

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



Signed-off-by: default avatarSheng Yong <shengyong1@huawei.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Git-commit: 212240dfd2d4ad979c1bd6d2318b8637ba24af09
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarNikhilesh Reddy <reddyn@codeaurora.org>
parent 24afc584
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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->mtd) / 100) * 5, UBI_FM_MAX_POOL_SIZE);
	if (ubi->fm_pool.max_size < UBI_FM_MIN_POOL_SIZE)
		ubi->fm_pool.max_size = UBI_FM_MIN_POOL_SIZE;
	ubi->fm_pool.max_size = max(ubi->fm_pool.max_size,
		UBI_FM_MIN_POOL_SIZE);

	ubi->fm_wl_pool.max_size = ubi->fm_pool.max_size / 2;
	ubi->fm_disabled = !fm_autoconvert;