aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips/cfi_cmdset_0001.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-08-02 17:14:21 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-08-02 18:45:18 +0100
commitc8872b069c536976b81bccfc95dda945594bc504 (patch)
treeff131bea50915d6ba95638a51a309af39e32cb84 /drivers/mtd/chips/cfi_cmdset_0001.c
parent[MTD] remove code associated with !CONFIG_PPC_MERGE (diff)
downloadlinux-dev-c8872b069c536976b81bccfc95dda945594bc504.tar.xz
linux-dev-c8872b069c536976b81bccfc95dda945594bc504.zip
[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.c2
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 {