udf: convert byte order of constant instead of variable
convert byte order of constant instead of variable,
which can be done at compile time (vs run time)
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index 585e4ea..a3a513f 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -74,8 +74,8 @@
if (UDF_I_LENEATTR(inode)) {
/* check checksum/crc */
- if (le16_to_cpu(eahd->descTag.tagIdent) !=
- TAG_IDENT_EAHD ||
+ if (eahd->descTag.tagIdent !=
+ cpu_to_le16(TAG_IDENT_EAHD) ||
le32_to_cpu(eahd->descTag.tagLocation) !=
UDF_I_LOCATION(inode).logicalBlockNum)
return NULL;
@@ -161,8 +161,8 @@
eahd = (struct extendedAttrHeaderDesc *)ea;
/* check checksum/crc */
- if (le16_to_cpu(eahd->descTag.tagIdent) !=
- TAG_IDENT_EAHD ||
+ if (eahd->descTag.tagIdent !=
+ cpu_to_le16(TAG_IDENT_EAHD) ||
le32_to_cpu(eahd->descTag.tagLocation) !=
UDF_I_LOCATION(inode).logicalBlockNum)
return NULL;
@@ -233,8 +233,8 @@
}
/* Verify the tag version */
- if (le16_to_cpu(tag_p->descVersion) != 0x0002U &&
- le16_to_cpu(tag_p->descVersion) != 0x0003U) {
+ if (tag_p->descVersion != cpu_to_le16(0x0002U) &&
+ tag_p->descVersion != cpu_to_le16(0x0003U)) {
udf_debug("tag version 0x%04x != 0x0002 || 0x0003 block %d\n",
le16_to_cpu(tag_p->descVersion), block);
goto error_out;