Thread (14 messages) 14 messages, 2 authors, 2012-03-21

[PATCH 10/11] super-intel.c: Use ROUND_UP() instead of manually coding it

flat view
STALE5315d

From: <hidden>
Date: 2012-03-20 16:54:15
Subsystem: the rest · Maintainer: Linus Torvalds

From: Jes Sorensen <redacted>

Signed-off-by: Jes Sorensen <redacted>
---
 super-intel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index 958edb5..a351b60 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -318,7 +318,7 @@ static void set_migr_type(struct imsm_dev *dev, __u8 migr_type)
 
 static unsigned int sector_count(__u32 bytes)
 {
-	return ((bytes + (512-1)) & (~(512-1))) / 512;
+	return ROUND_UP(bytes, 512) / 512;
 }
 
 static unsigned int mpb_sectors(struct imsm_super *mpb)
-- 
1.7.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help