drbd: Endianness convert the constants instead of the variables
authorAndreas Gruenbacher <agruen@linbit.com>
Tue, 11 Jan 2011 12:54:02 +0000 (13:54 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 25 Aug 2011 12:57:57 +0000 (14:57 +0200)
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>
drivers/block/drbd/drbd_actlog.c
drivers/block/drbd/drbd_main.c

index cf0e63dd97da9bf09a88bf364cba87956cea4f42..0eb17d3adf21f31c0b2c6b4d8b78a9005f9d5866 100644 (file)
@@ -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);
index 2cd132a91b8315386477ed348e11cfecc065e1bc..f65b8c532248293721062ab4ab4395021c9851b8 100644 (file)
@@ -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;
This page took 0.027555 seconds and 5 git commands to generate.