From 8949555ac66dc451b39d07607d3613036338ed67 Mon Sep 17 00:00:00 2001 From: Paul Keith Date: Wed, 14 Mar 2018 14:05:38 +0100 Subject: [PATCH] fs: sdfat: Fix compilation for 32-bit targets Change-Id: I9a9f3e253001bfbb3a209bd16d2741c95c99f46b --- amap_smart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/amap_smart.c b/amap_smart.c index 99e32a6..c32596e 100644 --- a/amap_smart.c +++ b/amap_smart.c @@ -325,6 +325,7 @@ int amap_create(struct super_block *sb, u32 pack_ratio, u32 sect_per_au, u32 hid int i, i_clu, i_au; int i_au_root = -1, i_au_hot_from = INT_MAX; u32 misaligned_sect = hidden_sect; + u64 tmp; BUG_ON(!fsi->bd_opened); @@ -383,7 +384,9 @@ int amap_create(struct super_block *sb, u32 pack_ratio, u32 sect_per_au, u32 hid amap->sb = sb; - amap->n_au = (fsi->num_sectors + misaligned_sect + sect_per_au - 1) / sect_per_au; + tmp = fsi->num_sectors + misaligned_sect + sect_per_au - 1; + do_div(tmp, sect_per_au); + amap->n_au = tmp; amap->n_clean_au = 0; amap->n_full_au = 0;