Skip to content

Commit

Permalink
UBI: Fastmap: Use max() to get the larger value
Browse files Browse the repository at this point in the history
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
shengyong authored and Richard Weinberger committed Jun 2, 2015
1 parent a1fe33a commit 212240d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/ubi/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 212240d

Please sign in to comment.