diff options
author | Julia Lawall <julia@diku.dk> | 2008-08-02 17:14:21 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-08-02 18:45:18 +0100 |
commit | c8872b069c536976b81bccfc95dda945594bc504 (patch) | |
tree | ff131bea50915d6ba95638a51a309af39e32cb84 /drivers/mtd/chips/cfi_cmdset_0001.c | |
parent | c4308d1076830a72e05eb3e5f58b9ed851229399 (diff) |
[MTD] Use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/chips/cfi_cmdset_0001.c')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0001.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index 5f1b472137a0..d49cbe2738a8 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -1640,7 +1640,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, /* Figure out the number of words to write */ word_gap = (-adr & (map_bankwidth(map)-1)); - words = (len - word_gap + map_bankwidth(map) - 1) / map_bankwidth(map); + words = DIV_ROUND_UP(len - word_gap, map_bankwidth(map)); if (!word_gap) { words--; } else { |