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)) {