Commit 6b44adc22e6f4cc4fe8e1bb6c69b6bf8ec8da533
1 parent
18e8672449
Exists in
master
and in
50 other branches
yaffs2: Use lldiv for 64bit division
Signed-off-by: Tom Rini <trini@ti.com>
Showing 2 changed files with 5 additions and 3 deletions Side-by-side Diff
fs/yaffs2/yaffs_uboot_glue.c
... | ... | @@ -20,6 +20,7 @@ |
20 | 20 | */ |
21 | 21 | |
22 | 22 | #include <common.h> |
23 | +#include <div64.h> | |
23 | 24 | |
24 | 25 | #include <config.h> |
25 | 26 | #include "nand.h" |
... | ... | @@ -184,7 +185,7 @@ |
184 | 185 | } |
185 | 186 | |
186 | 187 | if (end_block == 0) |
187 | - end_block = mtd->size / mtd->erasesize - 1; | |
188 | + end_block = lldiv(mtd->size, mtd->erasesize - 1); | |
188 | 189 | |
189 | 190 | if (end_block < start_block) { |
190 | 191 | printf("Bad start/end\n"); |
fs/yaffs2/yaffsfs.c
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | * published by the Free Software Foundation. |
12 | 12 | */ |
13 | 13 | |
14 | +#include <div64.h> | |
14 | 15 | #include "yaffsfs.h" |
15 | 16 | #include "yaffs_guts.h" |
16 | 17 | #include "yaffscfg.h" |
... | ... | @@ -1603,8 +1604,8 @@ |
1603 | 1604 | buf->st_rdev = obj->yst_rdev; |
1604 | 1605 | buf->st_size = yaffs_get_obj_length(obj); |
1605 | 1606 | buf->st_blksize = obj->my_dev->data_bytes_per_chunk; |
1606 | - buf->st_blocks = (buf->st_size + buf->st_blksize - 1) / | |
1607 | - buf->st_blksize; | |
1607 | + buf->st_blocks = lldiv(buf->st_size + buf->st_blksize - 1, | |
1608 | + buf->st_blksize); | |
1608 | 1609 | #if CONFIG_YAFFS_WINCE |
1609 | 1610 | buf->yst_wince_atime[0] = obj->win_atime[0]; |
1610 | 1611 | buf->yst_wince_atime[1] = obj->win_atime[1]; |