Unverified Commit 6827d50b authored by Konstantin Komarov's avatar Konstantin Komarov
Browse files

fs/ntfs3: Refactoring of various minor issues



Removed unused macro.
Changed null pointer checking.
Fixed inconsistent indenting.

Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent 30200ef8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -658,7 +658,8 @@ int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits)
	if (!wnd->bits_last)
		wnd->bits_last = wbits;

	wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
	wnd->free_bits =
		kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
	if (!wnd->free_bits)
		return -ENOMEM;

+4 −2
Original line number Diff line number Diff line
@@ -2599,8 +2599,10 @@ static inline bool is_reserved_name(struct ntfs_sb_info *sbi,
	if (len == 4 || (len > 4 && le16_to_cpu(name[4]) == '.')) {
		port_digit = le16_to_cpu(name[3]);
		if (port_digit >= '1' && port_digit <= '9')
			if (!ntfs_cmp_names(name, 3, COM_NAME, 3, upcase, false) ||
			    !ntfs_cmp_names(name, 3, LPT_NAME, 3, upcase, false))
			if (!ntfs_cmp_names(name, 3, COM_NAME, 3, upcase,
					    false) ||
			    !ntfs_cmp_names(name, 3, LPT_NAME, 3, upcase,
					    false))
				return true;
	}

+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,
	 * If the MFT record of ntfs inode is not a base record, inode->i_op can be NULL.
	 * This causes null pointer dereference in d_splice_alias().
	 */
	if (!IS_ERR(inode) && inode->i_op == NULL) {
	if (!IS_ERR_OR_NULL(inode) && !inode->i_op) {
		iput(inode);
		inode = ERR_PTR(-EINVAL);
	}
+0 −3
Original line number Diff line number Diff line
@@ -435,9 +435,6 @@ static inline u64 attr_svcn(const struct ATTRIB *attr)
	return attr->non_res ? le64_to_cpu(attr->nres.svcn) : 0;
}

/* The size of resident attribute by its resident size. */
#define BYTES_PER_RESIDENT(b) (0x18 + (b))

static_assert(sizeof(struct ATTRIB) == 0x48);
static_assert(sizeof(((struct ATTRIB *)NULL)->res) == 0x08);
static_assert(sizeof(((struct ATTRIB *)NULL)->nres) == 0x38);
+1 −1

File changed.

Contains only whitespace changes.