diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-01-16 12:08:43 -0500 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-01-18 07:27:44 -0500 |
commit | 3013ee31b6c5fd9a49a81816d6c13e1cdb7a1288 (patch) | |
tree | 96cb10bb6576c4cbeb9843831a56c371174b29dc /drivers/mtd/ubi/scan.c | |
parent | f429b2ea8eadb5a576542a70f7fd6f5c2a7455e1 (diff) |
UBI: use nicer 64-bit math
Get rid of 'do_div()' and use more user-friendly primitives from
'linux/math64.h'.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r-- | drivers/mtd/ubi/scan.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index ecde202a5a12..c3d653ba5ca0 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | #include <linux/err.h> | 43 | #include <linux/err.h> |
44 | #include <linux/crc32.h> | 44 | #include <linux/crc32.h> |
45 | #include <asm/div64.h> | 45 | #include <linux/math64.h> |
46 | #include "ubi.h" | 46 | #include "ubi.h" |
47 | 47 | ||
48 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID | 48 | #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID |
@@ -904,10 +904,8 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi) | |||
904 | dbg_msg("scanning is finished"); | 904 | dbg_msg("scanning is finished"); |
905 | 905 | ||
906 | /* Calculate mean erase counter */ | 906 | /* Calculate mean erase counter */ |
907 | if (si->ec_count) { | 907 | if (si->ec_count) |
908 | do_div(si->ec_sum, si->ec_count); | 908 | si->mean_ec = div_u64(si->ec_sum, si->ec_count); |
909 | si->mean_ec = si->ec_sum; | ||
910 | } | ||
911 | 909 | ||
912 | if (si->is_empty) | 910 | if (si->is_empty) |
913 | ubi_msg("empty MTD device detected"); | 911 | ubi_msg("empty MTD device detected"); |