From: Nicolas Pitre Date: Wed, 4 Nov 2015 20:21:21 +0000 (-0500) Subject: mtd: sm_ftl: fix wrong do_div() usage X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b2462d5928379b8f43ffe19d72d069bfb89d316;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mtd: sm_ftl: fix wrong do_div() usage do_div() is meant to be used with an unsigned dividend. Signed-off-by: Nicolas Pitre Signed-off-by: Brian Norris --- diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index c23184a47fc4..b096f8bb05ba 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @@ -206,9 +206,10 @@ static loff_t sm_mkoffset(struct sm_ftl *ftl, int zone, int block, int boffset) } /* Breaks offset into parts */ -static void sm_break_offset(struct sm_ftl *ftl, loff_t offset, +static void sm_break_offset(struct sm_ftl *ftl, loff_t loffset, int *zone, int *block, int *boffset) { + u64 offset = loffset; *boffset = do_div(offset, ftl->block_size); *block = do_div(offset, ftl->max_lba); *zone = offset >= ftl->zone_count ? -1 : offset;