Commit e7fad8af authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: Endianness convert the constants instead of the variables

Converting the constants happens at compile time.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent ca9bc12b
......@@ -407,7 +407,7 @@ static int drbd_al_read_tr(struct drbd_conf *mdev,
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);
......
......@@ -3729,7 +3729,7 @@ int drbd_md_read(struct drbd_conf *mdev, struct drbd_backing_dev *bdev)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment