提交 1c07db46 编写于 作者: N Nicolas Pitre

mtd/sm_ftl.c: fix wrong do_div() usage

do_div() is meant to be used with an unsigned dividend.
Signed-off-by: NNicolas Pitre <nico@linaro.org>
上级 c24ca5be
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册