From: shengyong Date: Tue, 26 May 2015 10:07:05 +0000 (+0000) Subject: UBI: Fastmap: Use max() to get the larger value X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=212240dfd2d4ad979c1bd6d2318b8637ba24af09;p=linux-beck.git UBI: Fastmap: Use max() to get the larger value Signed-off-by: Sheng Yong Signed-off-by: Richard Weinberger --- diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index b7f824d5ee88..ddeccdfbd026 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -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;