udf: convert byte order of constant instead of variable
[linux-2.6-microblaze.git] / fs / udf / misc.c
index 585e4ea..a3a513f 100644 (file)
@@ -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;