Commit 72bcfa77 authored by Anton Altaparmakov's avatar Anton Altaparmakov

NTFS: Change {const_,}cpu_to_le{16,32}(0) to just 0 as suggested by Al Viro.

Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent f5de856b
...@@ -54,6 +54,7 @@ ToDo/Notes: ...@@ -54,6 +54,7 @@ ToDo/Notes:
- Fix a bug found by the new sparse bitwise warnings where the default - Fix a bug found by the new sparse bitwise warnings where the default
upcase table was defined as a pointer to wchar_t rather than ntfschar upcase table was defined as a pointer to wchar_t rather than ntfschar
in fs/ntfs/ntfs.h and super.c. in fs/ntfs/ntfs.h and super.c.
- Change {const_,}cpu_to_le{16,32}(0) to just 0 as suggested by Al Viro.
2.1.18 - Fix scheduling latencies at mount time as well as an endianness bug. 2.1.18 - Fix scheduling latencies at mount time as well as an endianness bug.
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
* The little endian Unicode string $I30 as a global constant. * The little endian Unicode string $I30 as a global constant.
*/ */
ntfschar I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'), ntfschar I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
const_cpu_to_le16('3'), const_cpu_to_le16('0'), const_cpu_to_le16('3'), const_cpu_to_le16('0'), 0 };
const_cpu_to_le16(0) };
/** /**
* ntfs_lookup_inode_by_name - find an inode in a directory given its name * ntfs_lookup_inode_by_name - find an inode in a directory given its name
......
...@@ -130,7 +130,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na) ...@@ -130,7 +130,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
if (!ni->name) if (!ni->name)
return -ENOMEM; return -ENOMEM;
memcpy(ni->name, na->name, i); memcpy(ni->name, na->name, i);
ni->name[i] = cpu_to_le16(0); ni->name[i] = 0;
} }
return 0; return 0;
} }
......
...@@ -47,11 +47,11 @@ static void __format_mft_record(MFT_RECORD *m, const int size, ...@@ -47,11 +47,11 @@ static void __format_mft_record(MFT_RECORD *m, const int size,
*(le16*)((char*)m + ((sizeof(MFT_RECORD) + 1) & ~1)) = cpu_to_le16(1); *(le16*)((char*)m + ((sizeof(MFT_RECORD) + 1) & ~1)) = cpu_to_le16(1);
m->lsn = cpu_to_le64(0LL); m->lsn = cpu_to_le64(0LL);
m->sequence_number = cpu_to_le16(1); m->sequence_number = cpu_to_le16(1);
m->link_count = cpu_to_le16(0); m->link_count = 0;
/* Aligned to 8-byte boundary. */ /* Aligned to 8-byte boundary. */
m->attrs_offset = cpu_to_le16((le16_to_cpu(m->usa_ofs) + m->attrs_offset = cpu_to_le16((le16_to_cpu(m->usa_ofs) +
(le16_to_cpu(m->usa_count) << 1) + 7) & ~7); (le16_to_cpu(m->usa_count) << 1) + 7) & ~7);
m->flags = cpu_to_le16(0); m->flags = 0;
/* /*
* Using attrs_offset plus eight bytes (for the termination attribute), * Using attrs_offset plus eight bytes (for the termination attribute),
* aligned to 8-byte boundary. * aligned to 8-byte boundary.
...@@ -60,10 +60,10 @@ static void __format_mft_record(MFT_RECORD *m, const int size, ...@@ -60,10 +60,10 @@ static void __format_mft_record(MFT_RECORD *m, const int size,
~7); ~7);
m->bytes_allocated = cpu_to_le32(size); m->bytes_allocated = cpu_to_le32(size);
m->base_mft_record = cpu_to_le64((MFT_REF)0); m->base_mft_record = cpu_to_le64((MFT_REF)0);
m->next_attr_instance = cpu_to_le16(0); m->next_attr_instance = 0;
a = (ATTR_RECORD*)((char*)m + le16_to_cpu(m->attrs_offset)); a = (ATTR_RECORD*)((char*)m + le16_to_cpu(m->attrs_offset));
a->type = AT_END; a->type = AT_END;
a->length = cpu_to_le32(0); a->length = 0;
} }
/** /**
......
...@@ -1114,9 +1114,9 @@ static BOOL load_and_init_quota(ntfs_volume *vol) ...@@ -1114,9 +1114,9 @@ static BOOL load_and_init_quota(ntfs_volume *vol)
static const ntfschar Quota[7] = { const_cpu_to_le16('$'), static const ntfschar Quota[7] = { const_cpu_to_le16('$'),
const_cpu_to_le16('Q'), const_cpu_to_le16('u'), const_cpu_to_le16('Q'), const_cpu_to_le16('u'),
const_cpu_to_le16('o'), const_cpu_to_le16('t'), const_cpu_to_le16('o'), const_cpu_to_le16('t'),
const_cpu_to_le16('a'), const_cpu_to_le16(0) }; const_cpu_to_le16('a'), 0 };
static ntfschar Q[3] = { const_cpu_to_le16('$'), static ntfschar Q[3] = { const_cpu_to_le16('$'),
const_cpu_to_le16('Q'), const_cpu_to_le16(0) }; const_cpu_to_le16('Q'), 0 };
ntfs_debug("Entering."); ntfs_debug("Entering.");
/* /*
......
...@@ -276,7 +276,7 @@ int ntfs_nlstoucs(const ntfs_volume *vol, const char *ins, ...@@ -276,7 +276,7 @@ int ntfs_nlstoucs(const ntfs_volume *vol, const char *ins,
} /* else (wc_len < 0) */ } /* else (wc_len < 0) */
goto conversion_err; goto conversion_err;
} }
ucs[o] = cpu_to_le16(0); ucs[o] = 0;
*outs = ucs; *outs = ucs;
return o; return o;
} /* else (!ucs) */ } /* else (!ucs) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment