diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-01-11 07:54:02 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-08-25 08:57:57 -0400 |
commit | e7fad8af750c5780143e4b6876f80042ec0c21f5 (patch) | |
tree | 0dd568fea42843adb63331edda84414d65155d04 | |
parent | ca9bc12b90fbc4e2b1f81360f63842c9da54bb3c (diff) |
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>
-rw-r--r-- | drivers/block/drbd/drbd_actlog.c | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 2 |
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, | |||
407 | if (!drbd_md_sync_page_io(mdev, bdev, sector, READ)) | 407 | if (!drbd_md_sync_page_io(mdev, bdev, sector, READ)) |
408 | return -1; | 408 | return -1; |
409 | 409 | ||
410 | rv = (be32_to_cpu(b->magic) == DRBD_MAGIC); | 410 | rv = (b->magic == cpu_to_be32(DRBD_MAGIC)); |
411 | 411 | ||
412 | for (i = 0; i < AL_EXTENTS_PT + 1; i++) | 412 | for (i = 0; i < AL_EXTENTS_PT + 1; i++) |
413 | xor_sum ^= be32_to_cpu(b->updates[i].extent); | 413 | 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) | |||
3729 | goto err; | 3729 | goto err; |
3730 | } | 3730 | } |
3731 | 3731 | ||
3732 | if (be32_to_cpu(buffer->magic) != DRBD_MD_MAGIC) { | 3732 | if (buffer->magic != cpu_to_be32(DRBD_MD_MAGIC)) { |
3733 | dev_err(DEV, "Error while reading metadata, magic not found.\n"); | 3733 | dev_err(DEV, "Error while reading metadata, magic not found.\n"); |
3734 | rv = ERR_MD_INVALID; | 3734 | rv = ERR_MD_INVALID; |
3735 | goto err; | 3735 | goto err; |