From 04b04600f22b61ee6d11a58d34181907991f2094 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 24 Jul 2008 11:34:55 +0000 Subject: [PATCH] Trust the compiler to do optimize simple stuff like this. This also helps to avoid stupid mistakes. The driver works again, though things are still not stable. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26605 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/system/kernel/device_manager/dma_resource_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/system/kernel/device_manager/dma_resource_test.cpp b/src/tests/system/kernel/device_manager/dma_resource_test.cpp index 250e717ad7..b259058692 100644 --- a/src/tests/system/kernel/device_manager/dma_resource_test.cpp +++ b/src/tests/system/kernel/device_manager/dma_resource_test.cpp @@ -177,7 +177,7 @@ do_io(void* data, IOOperation* operation) const iovec& vec = operation->Vecs()[i]; addr_t base = (addr_t)vec.iov_base; size_t length = vec.iov_len; - size_t pageOffset = base & ~(B_PAGE_SIZE - 1); + size_t pageOffset = base % B_PAGE_SIZE; while (length > 0) { size_t toCopy = min_c(length, B_PAGE_SIZE - pageOffset);