aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
1178 * by one word. Thanks to Lynn Kerby for the fix and James McMechan 1178 * by one word. Thanks to Lynn Kerby for the fix and James McMechan
1179 * for the original diagnosis. 1179 * for the original diagnosis.
1180 */ 1180 */
1181 if(*cow_offset == ((bitmap_len + sizeof(unsigned long) - 1) / 1181 if (*cow_offset == (DIV_ROUND_UP(bitmap_len,
1182 sizeof(unsigned long) - 1)) 1182 sizeof(unsigned long)) - 1))
1183 (*cow_offset)--; 1183 (*cow_offset)--;
1184 1184
1185 bitmap_words[0] = bitmap[*cow_offset]; 1185 bitmap_words[0] = bitmap[*cow_offset];