Replace all le16 zero test conditions with "le16_cmpz(...)".
parent
90697bb5ab
commit
e366bef954
|
@ -853,7 +853,7 @@ int ntfs_inherit_acl(const ACL *oldacl, ACL *newacl,
|
|||
* Inheritance for access, specific to
|
||||
* creator-owner (and creator-group)
|
||||
*/
|
||||
if (fordir || !inherited
|
||||
if (fordir || le16_cmpz(inherited)
|
||||
|| (poldace->flags
|
||||
& (CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE))) {
|
||||
pnewace = (ACCESS_ALLOWED_ACE*)
|
||||
|
|
|
@ -3065,7 +3065,7 @@ find_attr_list_attr:
|
|||
/* Catch the end of the attribute list. */
|
||||
if ((u8*)al_entry == al_end)
|
||||
goto not_found;
|
||||
if (!al_entry->length)
|
||||
if (le16_cmpz(al_entry->length))
|
||||
break;
|
||||
if ((u8*)al_entry + 6 > al_end || (u8*)al_entry +
|
||||
le16_to_cpu(al_entry->length) > al_end)
|
||||
|
|
|
@ -222,7 +222,7 @@ static u8 *ntfs_ie_get_end(INDEX_HEADER *ih)
|
|||
|
||||
static int ntfs_ie_end(INDEX_ENTRY *ie)
|
||||
{
|
||||
return ie->ie_flags & INDEX_ENTRY_END || !ie->length;
|
||||
return ie->ie_flags & INDEX_ENTRY_END || le16_cmpz(ie->length);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3114,7 +3114,7 @@ static int insert_file_link_in_dir_index(INDEX_BLOCK *idx, leMFT_REF file_ref,
|
|||
do_next:
|
||||
#ifdef DEBUG
|
||||
/* Next entry. */
|
||||
if (!ie->length) {
|
||||
if (le16_cmpz(ie->length)) {
|
||||
ntfs_log_debug("BUG: ie->length is zero, breaking out "
|
||||
"of loop.\n");
|
||||
break;
|
||||
|
|
|
@ -791,7 +791,7 @@ static int reset_dirty(ntfs_volume *vol)
|
|||
{
|
||||
u16 flags;
|
||||
|
||||
if (!(vol->flags | VOLUME_IS_DIRTY))
|
||||
if (le16_cmpz(vol->flags | VOLUME_IS_DIRTY))
|
||||
return 0;
|
||||
|
||||
ntfs_log_verbose("Resetting dirty flag.\n");
|
||||
|
|
|
@ -558,7 +558,7 @@ static void dump_log_record(LOG_RECORD *lr)
|
|||
ntfs_log_info("transaction_id = 0x%x\n",
|
||||
(unsigned int)le32_to_cpu(lr->transaction_id));
|
||||
ntfs_log_info("flags = 0x%x:", lr->flags);
|
||||
if (!lr->flags)
|
||||
if (le16_cmpz(lr->flags))
|
||||
ntfs_log_info(" NONE\n");
|
||||
else {
|
||||
int _b = 0;
|
||||
|
|
|
@ -1662,7 +1662,7 @@ static int ntfs_dump_index_entries(INDEX_ENTRY *entry, INDEX_ATTR_TYPE type)
|
|||
ntfs_dump_index_data(entry, type);
|
||||
break;
|
||||
}
|
||||
if (!entry->length) {
|
||||
if (le16_cmpz(entry->length)) {
|
||||
ntfs_log_verbose("\tWARNING: Corrupt index entry, "
|
||||
"skipping the remainder of this index "
|
||||
"block.\n");
|
||||
|
|
|
@ -359,7 +359,7 @@ static void dump_resident_attr_val(ATTR_TYPES type, char *val, u32 val_len)
|
|||
i = VOL_INF(val)->flags;
|
||||
#undef VOL_INF
|
||||
printf("Volume flags = 0x%x: ", i);
|
||||
if (!i) {
|
||||
if (le16_cmpz(i)) {
|
||||
printf("NONE\n");
|
||||
return;
|
||||
}
|
||||
|
@ -580,7 +580,7 @@ static void dump_attr_record(MFT_RECORD *m, ATTR_RECORD *a)
|
|||
printf("Name = %s\n", s);
|
||||
}
|
||||
printf("Attribute flags = 0x%x: ", le16_to_cpu(u));
|
||||
if (!u)
|
||||
if (le16_cmpz(u))
|
||||
printf("NONE");
|
||||
else {
|
||||
int first = TRUE;
|
||||
|
|
Loading…
Reference in New Issue