summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers
diff options
context:
space:
mode:
authorJiri Olsa <olsajiri@gmail.com>2008-05-12 23:01:56 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-13 17:02:22 +0200
commit6d0742426c9adc7465ef5c62a99a1d3e9696ea19 (patch)
tree4e43e596ee52096a44331de90567678019c409f9 /arch/um/drivers
parentuml: fix CONFIG_RAW dependencies (diff)
downloadlinux-6d0742426c9adc7465ef5c62a99a1d3e9696ea19.tar.xz
linux-6d0742426c9adc7465ef5c62a99a1d3e9696ea19.zip
uml: use DIV_ROUND_UP
I just saw similar patches in the janitor kernel's list, and spotted place it fits. Signed-off-by: Jiri Olsa <olsajiri@gmail.com> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r--arch/um/drivers/ubd_kern.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 5e45e39a8a8d..44ad1607be2d 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1178,8 +1178,8 @@ static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask,
* by one word. Thanks to Lynn Kerby for the fix and James McMechan
* for the original diagnosis.
*/
- if(*cow_offset == ((bitmap_len + sizeof(unsigned long) - 1) /
- sizeof(unsigned long) - 1))
+ if (*cow_offset == (DIV_ROUND_UP(bitmap_len,
+ sizeof(unsigned long)) - 1))
(*cow_offset)--;
bitmap_words[0] = bitmap[*cow_offset];