mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
mtd: sm_ftl: fix wrong do_div() usage
do_div() is meant to be used with an unsigned dividend. Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
d55d31a6b8
commit
2b2462d592
1 changed files with 2 additions and 1 deletions
|
@ -206,9 +206,10 @@ static loff_t sm_mkoffset(struct sm_ftl *ftl, int zone, int block, int boffset)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Breaks offset into parts */
|
/* 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)
|
int *zone, int *block, int *boffset)
|
||||||
{
|
{
|
||||||
|
u64 offset = loffset;
|
||||||
*boffset = do_div(offset, ftl->block_size);
|
*boffset = do_div(offset, ftl->block_size);
|
||||||
*block = do_div(offset, ftl->max_lba);
|
*block = do_div(offset, ftl->max_lba);
|
||||||
*zone = offset >= ftl->zone_count ? -1 : offset;
|
*zone = offset >= ftl->zone_count ? -1 : offset;
|
||||||
|
|
Loading…
Reference in a new issue