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>
This commit is contained in:
committed by
Linus Torvalds
parent
4daa1b8799
commit
5e0f001736
@@ -74,8 +74,8 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
|
||||
|
||||
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 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,
|
||||
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 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
Reference in New Issue
Block a user