Converting the constants happens at compile time.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
if (!drbd_md_sync_page_io(mdev, bdev, sector, READ))
return -1;
- rv = (be32_to_cpu(b->magic) == DRBD_MAGIC);
+ rv = (b->magic == cpu_to_be32(DRBD_MAGIC));
for (i = 0; i < AL_EXTENTS_PT + 1; i++)
xor_sum ^= be32_to_cpu(b->updates[i].extent);
goto err;
}
- if (be32_to_cpu(buffer->magic) != DRBD_MD_MAGIC) {
+ if (buffer->magic != cpu_to_be32(DRBD_MD_MAGIC)) {
dev_err(DEV, "Error while reading metadata, magic not found.\n");
rv = ERR_MD_INVALID;
goto err;