Replace all le64 usage of the '==' operation with "le64_eq(...)".

edge.strict_endians
Erik Larsson 2016-01-28 08:28:28 +01:00
parent 0876896169
commit 7a88d7821e
4 changed files with 11 additions and 9 deletions

View File

@ -300,4 +300,6 @@
#define le32_eq(a, b) ((a) == (b))
#define le64_eq(a, b) ((a) == (b))
#endif /* defined _NTFS_ENDIANS_H */

View File

@ -894,11 +894,11 @@ static u32 ntfs_interix_types(ntfs_inode *ni)
if ((na->data_size >= (s64)sizeof(magic))
&& (ntfs_attr_pread(na, 0, sizeof(magic), &magic)
== sizeof(magic))) {
if (magic == INTX_SYMBOLIC_LINK)
if (le64_eq(magic, INTX_SYMBOLIC_LINK))
dt_type = NTFS_DT_LNK;
else if (magic == INTX_BLOCK_DEVICE)
else if (le64_eq(magic, INTX_BLOCK_DEVICE))
dt_type = NTFS_DT_BLK;
else if (magic == INTX_CHARACTER_DEVICE)
else if (le64_eq(magic, INTX_CHARACTER_DEVICE))
dt_type = NTFS_DT_CHR;
}
}

View File

@ -711,7 +711,7 @@ static int ntfs_fuse_getstat(struct SECURITY_CONTEXT *scx,
ntfs_attr_close(na);
goto exit;
}
if (intx_file->magic == INTX_BLOCK_DEVICE &&
if (le64_eq(intx_file->magic, INTX_BLOCK_DEVICE) &&
na->data_size == (s64)offsetof(
INTX_FILE, device_end)) {
stbuf->st_mode = S_IFBLK;
@ -720,7 +720,7 @@ static int ntfs_fuse_getstat(struct SECURITY_CONTEXT *scx,
le64_to_cpu(
intx_file->minor));
}
if (intx_file->magic == INTX_CHARACTER_DEVICE &&
if (le64_eq(intx_file->magic, INTX_CHARACTER_DEVICE) &&
na->data_size == (s64)offsetof(
INTX_FILE, device_end)) {
stbuf->st_mode = S_IFCHR;
@ -729,7 +729,7 @@ static int ntfs_fuse_getstat(struct SECURITY_CONTEXT *scx,
le64_to_cpu(
intx_file->minor));
}
if (intx_file->magic == INTX_SYMBOLIC_LINK)
if (le64_eq(intx_file->magic, INTX_SYMBOLIC_LINK))
stbuf->st_mode = S_IFLNK;
free(intx_file);
}

View File

@ -819,7 +819,7 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf)
ntfs_attr_close(na);
goto exit;
}
if (intx_file->magic == INTX_BLOCK_DEVICE &&
if (le64_eq(intx_file->magic, INTX_BLOCK_DEVICE) &&
na->data_size == offsetof(
INTX_FILE, device_end)) {
stbuf->st_mode = S_IFBLK;
@ -828,7 +828,7 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf)
le64_to_cpu(
intx_file->minor));
}
if (intx_file->magic == INTX_CHARACTER_DEVICE &&
if (le64_eq(intx_file->magic, INTX_CHARACTER_DEVICE) &&
na->data_size == offsetof(
INTX_FILE, device_end)) {
stbuf->st_mode = S_IFCHR;
@ -837,7 +837,7 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf)
le64_to_cpu(
intx_file->minor));
}
if (intx_file->magic == INTX_SYMBOLIC_LINK)
if (le64_eq(intx_file->magic, INTX_SYMBOLIC_LINK))
stbuf->st_mode = S_IFLNK;
free(intx_file);
}