summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2015-11-03 23:09:58 -0500
committerNicolas Pitre <nicolas.pitre@linaro.org>2015-11-16 12:39:56 -0500
commit1c07db46511f0d2335d3b32008f644164071d13e (patch)
tree42f1ff583d73479588693f1e59e3fdcb3eb4cc1a
parentc24ca5be763a402c7fce0bd073c17de901ad5e38 (diff)
downloadlinux-1c07db46511f0d2335d3b32008f644164071d13e.tar.gz
linux-1c07db46511f0d2335d3b32008f644164071d13e.tar.bz2
linux-1c07db46511f0d2335d3b32008f644164071d13e.zip
mtd/sm_ftl.c: fix wrong do_div() usage
do_div() is meant to be used with an unsigned dividend. Signed-off-by: Nicolas Pitre <nico@linaro.org>
-rw-r--r--drivers/mtd/sm_ftl.c3
1 files changed, 2 insertions, 1 deletions
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;