From c595b20e56f21505e8380c9b00801639143ee945 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 22 Mar 2014 20:43:05 +0100 Subject: [PATCH] dev-swap: use SECTOR_SHIFT --- lib/device/dev-swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/device/dev-swap.c b/lib/device/dev-swap.c index bf3604bb7..d1feb0c87 100644 --- a/lib/device/dev-swap.c +++ b/lib/device/dev-swap.c @@ -59,7 +59,7 @@ int dev_is_swap(struct device *dev, uint64_t *offset_found) */ if (page == 0x8000) continue; - if (size < (page / 512)) + if (size < (page >> SECTOR_SHIFT)) break; if (!dev_read(dev, page - SIGNATURE_SIZE, SIGNATURE_SIZE, buf)) {