Skip to content

Commit

Permalink
uml: use DIV_ROUND_UP
Browse files Browse the repository at this point in the history
I just saw similar patches in the janitor kernel's list, and spotted place it
fits.

Signed-off-by: Jiri Olsa <[email protected]>
Signed-off-by: Jeff Dike <[email protected]>
Cc: WANG Cong <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
olsajiri authored and torvalds committed May 13, 2008
1 parent 63b9871 commit 6d07424
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 6d07424

Please sign in to comment.