summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-01-11 15:54:02 +0300
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-08-25 16:57:57 +0400
commite7fad8af750c5780143e4b6876f80042ec0c21f5 (patch)
tree0dd568fea42843adb63331edda84414d65155d04 /drivers
parentca9bc12b90fbc4e2b1f81360f63842c9da54bb3c (diff)
downloadlinux-e7fad8af750c5780143e4b6876f80042ec0c21f5.tar.xz
drbd: Endianness convert the constants instead of the variables
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/drbd/drbd_actlog.c2
-rw-r--r--drivers/block/drbd/drbd_main.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c
index cf0e63dd97da..0eb17d3adf21 100644
--- a/drivers/block/drbd/drbd_actlog.c
+++ b/drivers/block/drbd/drbd_actlog.c
@@ -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);
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 2cd132a91b83..f65b8c532248 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -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;